home *** CD-ROM | disk | FTP | other *** search
/ Java 1.1 Unleashed (3rd Edition) / Java 1.1 Unleashed Third Edition (1997)(SAMS.net)(Version 1.0).ISO / pc / source / source.tar < prev    next >
Tape Archive  |  1997-05-07  |  8.0 MB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Tape Archive (archive/tar).

You can browse this item here: source.tar

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive (GNU) default
99% file POSIX tar archive (GNU), directory ./, mode 40777 , uid 0 , gid 0 , size 0 , seconds 6334002630, user root, group wheel default
98% file data default
99% TrID GRASP animation default
0% TrID Sybase iAnywhere database files default (weak)
0% TrID TAR - Tape ARchive (GNU) default (weak)
0% TrID TAR - Tape ARchive (directory) default (weak)
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype GNU tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive (GNU) default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 2e 2f 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |./......|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 37 37 20 00 20 20 20 20 |.... 407|77 . |
|00000070| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 33 33 34 30 30 32 | 0 | 6334002|
|00000090| 36 33 30 20 20 31 30 31 | 33 36 00 20 35 00 00 00 |630 101|36. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00000150| 20 20 20 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 0 ...|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 43 68 61 70 32 33 2f 00 | 00 00 00 00 00 00 00 00 |Chap23/.|........|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 20 34 30 37 | 37 37 20 00 20 20 20 20 |.... 407|77 . |
|00000270| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000280| 20 20 20 20 20 20 30 20 | 20 36 33 32 34 36 33 31 | 0 | 6324631|
|00000290| 35 33 32 20 20 31 31 30 | 33 31 00 20 35 00 00 00 |532 110|31. 5...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00000350| 20 20 20 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 0 ...|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 43 68 61 70 32 33 2f 43 | 68 6f 6f 73 65 43 6f 6c |Chap23/C|hooseCol|
|00000410| 6f 72 2f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |or/.....|........|
|00000420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000460| 00 00 00 00 20 34 30 37 | 37 37 20 00 20 20 20 20 |.... 407|77 . |
|00000470| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000480| 20 20 20 20 20 20 30 20 | 20 36 33 33 32 37 33 30 | 0 | 6332730|
|00000490| 33 32 32 20 20 31 33 32 | 34 34 00 20 35 00 00 00 |322 132|44. 5...|
|000004a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000004f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000500| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000520| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000540| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00000550| 20 20 20 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 0 ...|........|
|00000560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000005f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000600| 43 68 61 70 32 33 2f 43 | 68 6f 6f 73 65 43 6f 6c |Chap23/C|hooseCol|
|00000610| 6f 72 2f 65 78 61 6d 70 | 6c 65 31 2e 68 74 6d 6c |or/examp|le1.html|
|00000620| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000630| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000640| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000650| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000660| 00 00 00 00 31 30 30 36 | 36 36 20 00 20 20 20 20 |....1006|66 . |
|00000670| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000680| 20 20 20 20 31 37 34 20 | 20 36 32 37 37 30 35 30 | 174 | 6277050|
|00000690| 35 32 30 20 20 31 35 37 | 37 32 00 20 30 00 00 00 |520 157|72. 0...|
|000006a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000006f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000700| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000720| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00000750| 20 32 30 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 200 ...|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 3c 74 69 74 6c 65 3e 43 | 68 6f 6f 73 65 20 43 6f |<title>C|hoose Co|
|00000810| 6c 6f 72 20 44 69 61 6c | 6f 67 20 41 70 70 6c 65 |lor Dial|og Apple|
|00000820| 74 20 41 3c 2f 74 69 74 | 6c 65 3e 0d 0a 3c 68 72 |t A</tit|le>..<hr|
|00000830| 3e 0d 0a 3c 61 70 70 6c | 65 74 20 63 6f 64 65 3d |>..<appl|et code=|
|00000840| 22 43 68 6f 6f 73 65 43 | 6f 6c 6f 72 44 69 61 6c |"ChooseC|olorDial|
|00000850| 6f 67 41 70 70 6c 65 74 | 22 20 77 69 64 74 68 3d |ogApplet|" width=|
|00000860| 31 30 30 20 68 65 69 67 | 68 74 3d 31 30 30 3e 0d |100 heig|ht=100>.|
|00000870| 0a 3c 2f 61 70 70 6c 65 | 74 3e 0d 0a 00 00 00 00 |.</apple|t>......|
|00000880| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000890| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000008f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000009f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a00| 43 68 61 70 32 33 2f 43 | 68 6f 6f 73 65 43 6f 6c |Chap23/C|hooseCol|
|00000a10| 6f 72 2f 43 68 6f 6f 73 | 65 43 6f 6c 6f 72 44 69 |or/Choos|eColorDi|
|00000a20| 61 6c 6f 67 41 70 70 6c | 65 74 2e 6a 61 76 61 00 |alogAppl|et.java.|
|00000a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a60| 00 00 00 00 31 30 30 36 | 36 36 20 00 20 20 20 20 |....1006|66 . |
|00000a70| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000a80| 20 20 33 32 35 33 36 20 | 20 36 32 37 37 30 37 32 | 32536 | 6277072|
|00000a90| 31 33 36 20 20 32 31 30 | 31 36 00 20 30 00 00 00 |136 210|16. 0...|
|00000aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b00| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b20| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00000b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b40| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00000b50| 20 32 30 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 200 ...|........|
|00000b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c00| 0d 0a 2f 2a 20 43 68 6f | 6f 73 65 43 6f 6c 6f 72 |../* Cho|oseColor|
|00000c10| 44 69 61 6c 6f 67 41 70 | 70 6c 65 74 2e 6a 61 76 |DialogAp|plet.jav|
|00000c20| 61 09 09 09 41 75 74 68 | 6f 72 20 43 61 73 65 79 |a...Auth|or Casey|
|00000c30| 20 48 6f 70 73 6f 6e 0d | 0a 2a 20 20 09 09 09 09 | Hopson.|.* ....|
|00000c40| 09 09 09 20 20 20 47 65 | 69 73 74 20 53 6f 66 74 |... Ge|ist Soft|
|00000c50| 77 61 72 65 20 61 6e 64 | 20 53 65 72 76 69 63 65 |ware and| Service|
|00000c60| 73 2c 20 49 6e 63 2e 20 | 0d 0a 2a 0d 0a 2a 09 50 |s, Inc. |..*..*.P|
|00000c70| 65 72 6d 69 73 73 69 6f | 6e 20 74 6f 20 75 73 65 |ermissio|n to use|
|00000c80| 2c 20 63 6f 70 79 2c 20 | 6d 6f 64 69 66 79 2c 20 |, copy, |modify, |
|00000c90| 61 6e 64 20 64 69 73 74 | 72 69 62 75 74 65 0d 0a |and dist|ribute..|
|00000ca0| 2a 09 74 68 69 73 20 73 | 6f 66 74 77 61 72 65 20 |*.this s|oftware |
|00000cb0| 66 6f 72 20 4e 4f 4e 5f | 43 4f 4d 4d 45 52 43 49 |for NON_|COMMERCI|
|00000cc0| 41 4c 20 70 75 72 70 6f | 73 65 73 20 61 6e 64 20 |AL purpo|ses and |
|00000cd0| 77 69 74 68 6f 75 74 0d | 0a 2a 20 20 66 65 65 20 |without.|.* fee |
|00000ce0| 69 73 20 68 65 72 65 62 | 79 20 67 72 61 6e 74 65 |is hereb|y grante|
|00000cf0| 64 20 70 72 6f 76 69 64 | 65 64 20 74 68 61 74 20 |d provid|ed that |
|00000d00| 74 68 69 73 20 63 6f 70 | 79 72 69 67 68 74 20 6e |this cop|yright n|
|00000d10| 6f 74 69 63 65 0d 0a 2a | 20 20 61 70 70 65 61 72 |otice..*| appear|
|00000d20| 73 20 69 6e 20 61 6c 6c | 20 63 6f 70 69 65 73 2e |s in all| copies.|
|00000d30| 0d 0a 2a 0d 0a 2a 09 54 | 68 65 20 63 72 65 61 74 |..*..*.T|he creat|
|00000d40| 6f 72 73 20 6f 66 20 74 | 68 69 73 20 73 6f 66 74 |ors of t|his soft|
|00000d50| 77 61 72 65 20 6d 61 6b | 65 20 6e 6f 20 72 65 70 |ware mak|e no rep|
|00000d60| 72 65 73 65 6e 74 61 74 | 69 6f 6e 73 20 6f 72 0d |resentat|ions or.|
|00000d70| 0a 2a 09 77 61 72 72 61 | 6e 74 69 65 73 20 61 62 |.*.warra|nties ab|
|00000d80| 6f 75 74 20 74 68 65 20 | 73 75 69 74 61 62 69 6c |out the |suitabil|
|00000d90| 69 74 79 20 6f 66 20 74 | 68 65 20 73 6f 66 74 77 |ity of t|he softw|
|00000da0| 61 72 65 2c 20 65 69 74 | 68 65 72 0d 0a 2a 20 20 |are, eit|her..* |
|00000db0| 65 78 70 72 65 73 73 20 | 6f 72 20 69 6d 70 6c 69 |express |or impli|
|00000dc0| 65 64 2e 20 20 54 68 65 | 20 63 72 65 61 74 6f 72 |ed. The| creator|
|00000dd0| 73 20 73 68 61 6c 6c 20 | 6e 6f 74 20 62 65 20 6c |s shall |not be l|
|00000de0| 69 61 62 6c 65 20 66 6f | 72 0d 0a 2a 20 20 61 6e |iable fo|r..* an|
|00000df0| 79 20 64 61 6d 61 67 65 | 73 20 73 75 66 66 65 72 |y damage|s suffer|
|00000e00| 65 64 20 62 79 20 6c 69 | 63 65 6e 73 65 65 20 61 |ed by li|censee a|
|00000e10| 73 20 61 20 72 65 73 75 | 6c 74 20 6f 66 20 75 73 |s a resu|lt of us|
|00000e20| 69 6e 67 2c 0d 0a 2a 20 | 20 6d 6f 64 69 66 79 69 |ing,..* | modifyi|
|00000e30| 6e 67 20 6f 72 20 64 69 | 73 74 72 69 62 75 74 69 |ng or di|stributi|
|00000e40| 6e 67 20 74 68 69 73 20 | 73 6f 66 74 77 61 72 65 |ng this |software|
|00000e50| 20 6f 72 20 69 74 73 20 | 64 65 72 69 76 61 74 69 | or its |derivati|
|00000e60| 76 65 73 2e 0d 0a 2a 2f | 0d 0a 0d 0a 0d 0a 0d 0a |ves...*/|........|
|00000e70| 69 6d 70 6f 72 74 20 6a | 61 76 61 2e 61 70 70 6c |import j|ava.appl|
|00000e80| 65 74 2e 2a 3b 0d 0a 69 | 6d 70 6f 72 74 20 6a 61 |et.*;..i|mport ja|
|00000e90| 76 61 2e 61 77 74 2e 2a | 3b 0d 0a 69 6d 70 6f 72 |va.awt.*|;..impor|
|00000ea0| 74 20 6a 61 76 61 2e 61 | 77 74 2e 65 76 65 6e 74 |t java.a|wt.event|
|00000eb0| 2e 2a 3b 0d 0a 69 6d 70 | 6f 72 74 20 6a 61 76 61 |.*;..imp|ort java|
|00000ec0| 2e 6c 61 6e 67 2e 2a 3b | 0d 0a 0d 0a 0d 0a 2f 2f |.lang.*;|......//|
|00000ed0| 20 44 69 61 6c 6f 67 20 | 62 6f 78 20 66 6f 72 20 | Dialog |box for |
|00000ee0| 63 68 6f 6f 73 69 6e 67 | 20 64 69 73 70 6c 61 79 |choosing| display|
|00000ef0| 20 63 6f 6c 6f 72 73 2e | 2e 2e 0d 0a 70 75 62 6c | colors.|....publ|
|00000f00| 69 63 20 63 6c 61 73 73 | 20 43 68 6f 6f 73 65 43 |ic class| ChooseC|
|00000f10| 6f 6c 6f 72 44 69 61 6c | 6f 67 41 70 70 6c 65 74 |olorDial|ogApplet|
|00000f20| 20 65 78 74 65 6e 64 73 | 20 41 70 70 6c 65 74 20 | extends| Applet |
|00000f30| 7b 0d 0a 20 20 20 20 70 | 75 62 6c 69 63 20 76 6f |{.. p|ublic vo|
|00000f40| 69 64 20 69 6e 69 74 28 | 29 20 7b 0d 0a 20 20 20 |id init(|) {.. |
|00000f50| 20 20 20 2f 2f 20 43 72 | 65 61 74 65 20 74 68 65 | // Cr|eate the|
|00000f60| 20 66 72 61 6d 65 20 77 | 69 74 68 20 61 20 74 69 | frame w|ith a ti|
|00000f70| 74 6c 65 2e 2e 2e 0d 0a | 20 20 20 20 20 20 6e 65 |tle.....| ne|
|00000f80| 77 20 43 68 6f 6f 73 65 | 43 6f 6c 6f 72 44 69 61 |w Choose|ColorDia|
|00000f90| 6c 6f 67 46 72 61 6d 65 | 28 22 53 68 6f 77 20 43 |logFrame|("Show C|
|00000fa0| 6f 6c 6f 72 20 44 69 61 | 6c 6f 67 22 29 3b 20 0d |olor Dia|log"); .|
|00000fb0| 0a 20 20 20 20 7d 0d 0a | 7d 20 20 20 20 20 20 0d |. }..|} .|
|00000fc0| 0a 0d 0a 63 6c 61 73 73 | 20 43 68 6f 6f 73 65 43 |...class| ChooseC|
|00000fd0| 6f 6c 6f 72 44 69 61 6c | 6f 67 46 72 61 6d 65 20 |olorDial|ogFrame |
|00000fe0| 65 78 74 65 6e 64 73 20 | 46 72 61 6d 65 20 7b 0d |extends |Frame {.|
|00000ff0| 0a 20 20 20 20 70 75 62 | 6c 69 63 20 43 68 6f 6f |. pub|lic Choo|
|00001000| 73 65 43 6f 6c 6f 72 44 | 69 61 6c 6f 67 46 72 61 |seColorD|ialogFra|
|00001010| 6d 65 28 53 74 72 69 6e | 67 20 74 69 74 6c 65 29 |me(Strin|g title)|
|00001020| 20 7b 0d 0a 20 20 20 20 | 20 20 20 2f 2f 20 43 61 | {.. | // Ca|
|00001030| 6c 6c 20 74 68 65 20 73 | 75 70 65 72 63 6c 61 73 |ll the s|uperclas|
|00001040| 73 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 2e 2e 2e |s constr|uctor...|
|00001050| 0d 0a 20 20 20 20 20 20 | 20 73 75 70 65 72 28 74 |.. | super(t|
|00001060| 69 74 6c 65 29 3b 0d 0a | 20 20 20 20 20 20 20 2f |itle);..| /|
|00001070| 2f 20 43 72 65 61 74 65 | 20 61 6e 64 20 73 68 6f |/ Create| and sho|
|00001080| 77 20 74 68 65 20 64 69 | 61 6c 6f 67 0d 0a 20 20 |w the di|alog.. |
|00001090| 20 20 20 20 20 43 68 6f | 6f 73 65 43 6f 6c 6f 72 | Cho|oseColor|
|000010a0| 44 69 61 6c 6f 67 20 64 | 6c 67 20 3d 20 6e 65 77 |Dialog d|lg = new|
|000010b0| 20 43 68 6f 6f 73 65 43 | 6f 6c 6f 72 44 69 61 6c | ChooseC|olorDial|
|000010c0| 6f 67 28 74 68 69 73 2c | 74 72 75 65 29 3b 0d 0a |og(this,|true);..|
|000010d0| 20 20 20 20 20 20 20 64 | 6c 67 2e 73 68 6f 77 28 | d|lg.show(|
|000010e0| 29 3b 0d 0a 20 20 20 20 | 7d 0d 0a 7d 0d 0a 0d 0a |);.. |}..}....|
|000010f0| 0d 0a 2f 2f 20 4c 69 73 | 74 65 6e 65 72 73 20 66 |..// Lis|teners f|
|00001100| 6f 72 20 74 68 65 20 43 | 6f 6c 6f 72 20 44 69 61 |or the C|olor Dia|
|00001110| 6c 6f 67 0d 0a 2f 2f 20 | 54 68 69 73 20 6f 6e 65 |log..// |This one|
|00001120| 20 69 73 20 66 6f 72 20 | 74 68 65 20 6c 69 73 74 | is for |the list|
|00001130| 62 6f 78 2e 2e 2e 0d 0a | 63 6c 61 73 73 20 43 6f |box.....|class Co|
|00001140| 6c 6f 72 4c 69 73 74 62 | 6f 78 4c 69 73 74 65 6e |lorListb|oxListen|
|00001150| 65 72 20 69 6d 70 6c 65 | 6d 65 6e 74 73 20 49 74 |er imple|ments It|
|00001160| 65 6d 4c 69 73 74 65 6e | 65 72 20 7b 0d 0a 20 20 |emListen|er {.. |
|00001170| 20 43 68 6f 6f 73 65 43 | 6f 6c 6f 72 44 69 61 6c | ChooseC|olorDial|
|00001180| 6f 67 20 64 6c 67 3b 20 | 2f 2f 20 54 68 65 20 63 |og dlg; |// The c|
|00001190| 6f 6c 6f 72 20 64 69 61 | 6c 6f 67 2e 2e 2e 0d 0a |olor dia|log.....|
|000011a0| 20 20 20 2f 2f 20 43 6f | 6e 73 74 72 75 63 74 6f | // Co|nstructo|
|000011b0| 72 2e 2e 2e 0d 0a 20 20 | 20 70 75 62 6c 69 63 20 |r..... | public |
|000011c0| 43 6f 6c 6f 72 4c 69 73 | 74 62 6f 78 4c 69 73 74 |ColorLis|tboxList|
|000011d0| 65 6e 65 72 28 43 68 6f | 6f 73 65 43 6f 6c 6f 72 |ener(Cho|oseColor|
|000011e0| 44 69 61 6c 6f 67 20 64 | 6c 67 29 20 7b 0d 0a 20 |Dialog d|lg) {.. |
|000011f0| 20 20 20 20 20 20 20 74 | 68 69 73 2e 64 6c 67 20 | t|his.dlg |
|00001200| 3d 20 64 6c 67 3b 0d 0a | 20 20 20 7d 0d 0a 20 20 |= dlg;..| }.. |
|00001210| 20 2f 2f 20 48 61 6e 64 | 6c 65 20 74 68 65 20 61 | // Hand|le the a|
|00001220| 63 74 69 6f 6e 20 74 6f | 20 62 65 20 70 65 72 66 |ction to| be perf|
|00001230| 6f 72 6d 65 64 2e 2e 2e | 0d 0a 20 20 20 70 75 62 |ormed...|.. pub|
|00001240| 6c 69 63 20 76 6f 69 64 | 20 69 74 65 6d 53 74 61 |lic void| itemSta|
|00001250| 74 65 43 68 61 6e 67 65 | 64 28 49 74 65 6d 45 76 |teChange|d(ItemEv|
|00001260| 65 6e 74 20 65 29 20 7b | 0d 0a 20 20 20 20 20 20 |ent e) {|.. |
|00001270| 20 64 6c 67 2e 73 65 6c | 65 63 74 65 64 43 68 6f | dlg.sel|ectedCho|
|00001280| 69 63 65 4c 69 73 74 49 | 74 65 6d 28 29 3b 0d 0a |iceListI|tem();..|
|00001290| 20 20 20 7d 0d 0a 7d 0d | 0a 2f 2f 20 54 68 69 73 | }..}.|.// This|
|000012a0| 20 6f 6e 65 20 69 73 20 | 66 6f 72 20 74 68 65 20 | one is |for the |
|000012b0| 63 68 65 63 6b 62 6f 78 | 65 73 2e 2e 2e 2e 2e 2e |checkbox|es......|
|000012c0| 0d 0a 63 6c 61 73 73 20 | 43 6f 6c 6f 72 43 68 65 |..class |ColorChe|
|000012d0| 63 6b 62 6f 78 4c 69 73 | 74 65 6e 65 72 20 69 6d |ckboxLis|tener im|
|000012e0| 70 6c 65 6d 65 6e 74 73 | 20 49 74 65 6d 4c 69 73 |plements| ItemLis|
|000012f0| 74 65 6e 65 72 20 7b 0d | 0a 20 20 20 43 68 6f 6f |tener {.|. Choo|
|00001300| 73 65 43 6f 6c 6f 72 44 | 69 61 6c 6f 67 20 64 6c |seColorD|ialog dl|
|00001310| 67 3b 20 2f 2f 20 54 68 | 65 20 63 6f 6c 6f 72 20 |g; // Th|e color |
|00001320| 64 69 61 6c 6f 67 2e 2e | 2e 0d 0a 20 20 20 2f 2f |dialog..|... //|
|00001330| 20 43 6f 6e 73 74 72 75 | 63 74 6f 72 2e 2e 2e 0d | Constru|ctor....|
|00001340| 0a 20 20 20 70 75 62 6c | 69 63 20 43 6f 6c 6f 72 |. publ|ic Color|
|00001350| 43 68 65 63 6b 62 6f 78 | 4c 69 73 74 65 6e 65 72 |Checkbox|Listener|
|00001360| 28 43 68 6f 6f 73 65 43 | 6f 6c 6f 72 44 69 61 6c |(ChooseC|olorDial|
|00001370| 6f 67 20 64 6c 67 29 20 | 7b 0d 0a 20 20 20 20 20 |og dlg) |{.. |
|00001380| 20 20 20 74 68 69 73 2e | 64 6c 67 20 3d 20 64 6c | this.|dlg = dl|
|00001390| 67 3b 0d 0a 20 20 20 7d | 0d 0a 20 20 20 2f 2f 20 |g;.. }|.. // |
|000013a0| 48 61 6e 64 6c 65 20 74 | 68 65 20 61 63 74 69 6f |Handle t|he actio|
|000013b0| 6e 20 74 6f 20 62 65 20 | 70 65 72 66 6f 72 6d 65 |n to be |performe|
|000013c0| 64 2e 2e 2e 0d 0a 20 20 | 20 70 75 62 6c 69 63 20 |d..... | public |
|000013d0| 76 6f 69 64 20 69 74 65 | 6d 53 74 61 74 65 43 68 |void ite|mStateCh|
|000013e0| 61 6e 67 65 64 28 49 74 | 65 6d 45 76 65 6e 74 20 |anged(It|emEvent |
|000013f0| 65 29 20 7b 0d 0a 20 20 | 20 20 20 20 20 64 6c 67 |e) {.. | dlg|
|00001400| 2e 73 65 6c 65 63 74 65 | 64 52 61 64 69 6f 49 74 |.selecte|dRadioIt|
|00001410| 65 6d 28 29 3b 0d 0a 20 | 20 20 7d 0d 0a 7d 0d 0a |em();.. | }..}..|
|00001420| 63 6c 61 73 73 20 43 68 | 6f 6f 73 65 41 63 74 69 |class Ch|ooseActi|
|00001430| 6f 6e 4c 69 73 74 65 6e | 65 72 20 69 6d 70 6c 65 |onListen|er imple|
|00001440| 6d 65 6e 74 73 20 41 63 | 74 69 6f 6e 4c 69 73 74 |ments Ac|tionList|
|00001450| 65 6e 65 72 20 7b 0d 0a | 20 20 20 2f 2f 20 41 63 |ener {..| // Ac|
|00001460| 74 69 6f 6e 73 20 6f 6e | 20 74 68 65 20 64 69 61 |tions on| the dia|
|00001470| 6c 6f 67 2e 2e 2e 0d 0a | 20 20 20 43 68 6f 6f 73 |log.....| Choos|
|00001480| 65 43 6f 6c 6f 72 44 69 | 61 6c 6f 67 20 64 6c 67 |eColorDi|alog dlg|
|00001490| 3b 20 2f 2f 20 54 68 65 | 20 63 6f 6c 6f 72 20 64 |; // The| color d|
|000014a0| 69 61 6c 6f 67 2e 2e 2e | 0d 0a 20 20 20 2f 2f 20 |ialog...|.. // |
|000014b0| 43 6f 6e 73 74 72 75 63 | 74 6f 72 2e 2e 2e 0d 0a |Construc|tor.....|
|000014c0| 20 20 20 70 75 62 6c 69 | 63 20 43 68 6f 6f 73 65 | publi|c Choose|
|000014d0| 41 63 74 69 6f 6e 4c 69 | 73 74 65 6e 65 72 28 43 |ActionLi|stener(C|
|000014e0| 68 6f 6f 73 65 43 6f 6c | 6f 72 44 69 61 6c 6f 67 |hooseCol|orDialog|
|000014f0| 20 64 6c 67 29 20 7b 0d | 0a 20 20 20 20 20 20 74 | dlg) {.|. t|
|00001500| 68 69 73 2e 64 6c 67 20 | 3d 20 64 6c 67 3b 0d 0a |his.dlg |= dlg;..|
|00001510| 20 20 20 7d 0d 0a 20 20 | 20 2f 2f 20 48 61 6e 64 | }.. | // Hand|
|00001520| 6c 65 20 74 68 65 20 61 | 63 74 69 6f 6e 20 74 6f |le the a|ction to|
|00001530| 20 62 65 20 70 65 72 66 | 6f 72 6d 65 64 2e 2e 2e | be perf|ormed...|
|00001540| 0d 0a 20 20 20 70 75 62 | 6c 69 63 20 76 6f 69 64 |.. pub|lic void|
|00001550| 20 61 63 74 69 6f 6e 50 | 65 72 66 6f 72 6d 65 64 | actionP|erformed|
|00001560| 28 41 63 74 69 6f 6e 45 | 76 65 6e 74 20 65 29 20 |(ActionE|vent e) |
|00001570| 7b 0d 0a 20 20 20 20 20 | 20 20 2f 2f 20 47 65 74 |{.. | // Get|
|00001580| 20 74 68 65 20 61 63 74 | 69 6f 6e 20 74 68 61 74 | the act|ion that|
|00001590| 20 6f 63 63 75 72 65 64 | 2e 2e 2e 0d 0a 20 20 20 | occured|..... |
|000015a0| 20 20 20 20 53 74 72 69 | 6e 67 20 73 65 6c 65 63 | Stri|ng selec|
|000015b0| 74 69 6f 6e 20 3d 20 65 | 2e 67 65 74 41 63 74 69 |tion = e|.getActi|
|000015c0| 6f 6e 43 6f 6d 6d 61 6e | 64 28 29 3b 0d 0a 20 20 |onComman|d();.. |
|000015d0| 20 20 20 20 20 69 66 20 | 28 73 65 6c 65 63 74 69 | if |(selecti|
|000015e0| 6f 6e 2e 65 71 75 61 6c | 73 28 22 55 70 64 61 74 |on.equal|s("Updat|
|000015f0| 65 22 29 29 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |e")).. | |
|00001600| 20 20 64 6c 67 2e 75 70 | 64 61 74 65 28 29 3b 0d | dlg.up|date();.|
|00001610| 0a 20 20 20 20 20 20 20 | 2f 2f 20 4f 74 68 65 72 |. |// Other|
|00001620| 77 69 73 65 20 64 65 73 | 74 72 6f 79 20 74 68 65 |wise des|troy the|
|00001630| 20 44 69 61 6c 6f 67 2e | 2e 2e 0d 0a 20 20 20 20 | Dialog.|.... |
|00001640| 20 20 20 69 66 20 28 73 | 65 6c 65 63 74 69 6f 6e | if (s|election|
|00001650| 2e 65 71 75 61 6c 73 28 | 22 43 61 6e 63 65 6c 22 |.equals(|"Cancel"|
|00001660| 29 29 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |)).. | |
|00001670| 64 6c 67 2e 64 69 73 70 | 6f 73 65 28 29 3b 0d 0a |dlg.disp|ose();..|
|00001680| 20 20 20 7d 0d 0a 7d 0d | 0a 0d 0a 0d 0a 0d 0a 2f | }..}.|......./|
|00001690| 2f 20 44 69 61 6c 6f 67 | 20 62 6f 78 20 66 6f 72 |/ Dialog| box for|
|000016a0| 20 63 68 6f 6f 73 69 6e | 67 20 64 69 73 70 6c 61 | choosin|g displa|
|000016b0| 79 20 63 6f 6c 6f 72 73 | 2e 2e 2e 0d 0a 63 6c 61 |y colors|.....cla|
|000016c0| 73 73 20 43 68 6f 6f 73 | 65 43 6f 6c 6f 72 44 69 |ss Choos|eColorDi|
|000016d0| 61 6c 6f 67 20 65 78 74 | 65 6e 64 73 20 44 69 61 |alog ext|ends Dia|
|000016e0| 6c 6f 67 20 7b 0d 0a 20 | 20 20 43 6f 6c 6f 72 65 |log {.. | Colore|
|000016f0| 64 43 68 65 63 6b 62 6f | 78 47 72 6f 75 70 20 63 |dCheckbo|xGroup c|
|00001700| 6f 6c 6f 72 47 72 70 3b | 20 20 2f 2f 20 54 6f 20 |olorGrp;| // To |
|00001710| 68 6f 6c 64 20 72 61 64 | 69 6f 20 62 75 74 74 6f |hold rad|io butto|
|00001720| 6e 73 20 6f 66 20 63 6f | 6c 6f 72 73 2e 2e 2e 0d |ns of co|lors....|
|00001730| 0a 20 20 20 4c 69 73 74 | 20 63 68 6f 69 63 65 4c |. List| choiceL|
|00001740| 69 73 74 3b 20 20 2f 2f | 20 4c 69 73 74 20 6f 66 |ist; //| List of|
|00001750| 20 63 6f 6c 6f 72 20 63 | 68 6f 69 63 65 73 2e 2e | color c|hoices..|
|00001760| 2e 0d 0a 20 20 20 63 6f | 6c 6f 72 44 69 73 70 6c |... co|lorDispl|
|00001770| 61 79 20 64 3b 20 2f 2f | 20 54 68 69 73 20 69 73 |ay d; //| This is|
|00001780| 20 74 68 65 20 74 65 78 | 74 20 64 69 73 70 6c 61 | the tex|t displa|
|00001790| 79 2e 2e 2e 0d 0a 20 20 | 20 2f 2f 20 44 65 66 69 |y..... | // Defi|
|000017a0| 6e 65 73 20 66 6f 72 20 | 6c 69 73 74 62 6f 78 20 |nes for |listbox |
|000017b0| 76 61 6c 75 65 73 2e 2e | 2e 0d 0a 20 20 20 73 74 |values..|... st|
|000017c0| 61 74 69 63 20 66 69 6e | 61 6c 20 69 6e 74 20 4e |atic fin|al int N|
|000017d0| 4f 52 4d 41 4c 5f 46 4f | 52 45 20 3d 20 30 3b 0d |ORMAL_FO|RE = 0;.|
|000017e0| 0a 20 20 20 73 74 61 74 | 69 63 20 66 69 6e 61 6c |. stat|ic final|
|000017f0| 20 69 6e 74 20 4e 4f 52 | 4d 41 4c 5f 42 41 43 4b | int NOR|MAL_BACK|
|00001800| 20 3d 20 31 3b 0d 0a 20 | 20 20 73 74 61 74 69 63 | = 1;.. | static|
|00001810| 20 66 69 6e 61 6c 20 69 | 6e 74 20 48 49 4c 49 54 | final i|nt HILIT|
|00001820| 45 5f 46 4f 52 45 20 3d | 20 32 3b 0d 0a 20 20 20 |E_FORE =| 2;.. |
|00001830| 73 74 61 74 69 63 20 66 | 69 6e 61 6c 20 69 6e 74 |static f|inal int|
|00001840| 20 48 49 4c 49 54 45 5f | 42 41 43 4b 20 3d 20 33 | HILITE_|BACK = 3|
|00001850| 3b 0d 0a 20 20 20 43 6f | 6c 6f 72 20 6e 6f 72 6d |;.. Co|lor norm|
|00001860| 61 6c 46 6f 72 65 43 6f | 6c 6f 72 3b 0d 0a 20 20 |alForeCo|lor;.. |
|00001870| 20 43 6f 6c 6f 72 20 6e | 6f 72 6d 61 6c 42 61 63 | Color n|ormalBac|
|00001880| 6b 43 6f 6c 6f 72 3b 0d | 0a 20 20 20 43 6f 6c 6f |kColor;.|. Colo|
|00001890| 72 20 68 69 67 68 6c 69 | 67 68 74 65 64 46 6f 72 |r highli|ghtedFor|
|000018a0| 65 43 6f 6c 6f 72 3b 0d | 0a 20 20 20 43 6f 6c 6f |eColor;.|. Colo|
|000018b0| 72 20 68 69 67 68 6c 69 | 67 68 74 65 64 42 61 63 |r highli|ghtedBac|
|000018c0| 6b 43 6f 6c 6f 72 3b 0d | 0a 0d 0a 20 20 20 2f 2f |kColor;.|... //|
|000018d0| 20 43 6f 6e 73 74 72 75 | 63 74 20 64 69 61 6c 6f | Constru|ct dialo|
|000018e0| 67 20 74 6f 20 61 6c 6c | 6f 77 20 63 6f 6c 6f 72 |g to all|ow color|
|000018f0| 20 74 6f 20 62 65 20 63 | 68 6f 73 65 6e 2e 2e 2e | to be c|hosen...|
|00001900| 0d 0a 09 70 75 62 6c 69 | 63 20 43 68 6f 6f 73 65 |...publi|c Choose|
|00001910| 43 6f 6c 6f 72 44 69 61 | 6c 6f 67 28 46 72 61 6d |ColorDia|log(Fram|
|00001920| 65 20 70 61 72 65 6e 74 | 2c 62 6f 6f 6c 65 61 6e |e parent|,boolean|
|00001930| 20 6d 6f 64 61 6c 29 20 | 7b 0d 0a 09 20 20 2f 2f | modal) |{... //|
|00001940| 20 43 72 65 61 74 65 20 | 64 69 61 6c 6f 67 20 77 | Create |dialog w|
|00001950| 69 74 68 20 74 69 74 6c | 65 0d 0a 09 20 20 73 75 |ith titl|e... su|
|00001960| 70 65 72 28 70 61 72 65 | 6e 74 2c 22 43 6f 6c 6f |per(pare|nt,"Colo|
|00001970| 72 20 44 69 61 6c 6f 67 | 22 2c 6d 6f 64 61 6c 29 |r Dialog|",modal)|
|00001980| 3b 0d 0a 20 20 20 20 20 | 20 2f 2f 20 49 6e 69 74 |;.. | // Init|
|00001990| 69 61 6c 69 7a 65 20 74 | 68 65 20 63 6f 6c 6f 72 |ialize t|he color|
|000019a0| 73 2e 2e 2e 0d 0a 20 20 | 20 20 20 20 6e 6f 72 6d |s..... | norm|
|000019b0| 61 6c 46 6f 72 65 43 6f | 6c 6f 72 20 3d 20 43 6f |alForeCo|lor = Co|
|000019c0| 6c 6f 72 2e 62 6c 61 63 | 6b 3b 0d 0a 20 20 20 20 |lor.blac|k;.. |
|000019d0| 20 20 6e 6f 72 6d 61 6c | 42 61 63 6b 43 6f 6c 6f | normal|BackColo|
|000019e0| 72 20 3d 20 43 6f 6c 6f | 72 2e 77 68 69 74 65 3b |r = Colo|r.white;|
|000019f0| 0d 0a 20 20 20 20 20 20 | 68 69 67 68 6c 69 67 68 |.. |highligh|
|00001a00| 74 65 64 46 6f 72 65 43 | 6f 6c 6f 72 20 3d 20 43 |tedForeC|olor = C|
|00001a10| 6f 6c 6f 72 2e 62 6c 61 | 63 6b 3b 0d 0a 20 20 20 |olor.bla|ck;.. |
|00001a20| 20 20 20 68 69 67 68 6c | 69 67 68 74 65 64 42 61 | highl|ightedBa|
|00001a30| 63 6b 43 6f 6c 6f 72 20 | 3d 20 43 6f 6c 6f 72 2e |ckColor |= Color.|
|00001a40| 77 68 69 74 65 3b 0d 0a | 20 20 20 20 20 20 2f 2f |white;..| //|
|00001a50| 20 43 72 65 61 74 65 20 | 74 68 65 20 64 69 61 6c | Create |the dial|
|00001a60| 6f 67 20 63 6f 6d 70 6f | 6e 65 6e 74 73 2e 2e 2e |og compo|nents...|
|00001a70| 0d 0a 20 20 20 20 20 20 | 63 72 65 61 74 65 43 6f |.. |createCo|
|00001a80| 6d 70 6f 6e 65 6e 74 73 | 28 29 3b 0d 0a 09 20 20 |mponents|();... |
|00001a90| 70 61 63 6b 28 29 3b 20 | 20 2f 2f 20 43 6f 6d 70 |pack(); | // Comp|
|00001aa0| 61 63 74 2e 2e 2e 0d 0a | 20 20 20 20 20 20 2f 2f |act.....| //|
|00001ab0| 20 52 65 73 69 7a 65 20 | 74 6f 20 66 69 74 20 65 | Resize |to fit e|
|00001ac0| 76 65 72 79 74 68 69 6e | 67 2e 2e 2e 0d 0a 20 20 |verythin|g..... |
|00001ad0| 20 20 20 20 72 65 73 69 | 7a 65 28 70 72 65 66 65 | resi|ze(prefe|
|00001ae0| 72 72 65 64 53 69 7a 65 | 28 29 29 3b 0d 0a 09 7d |rredSize|());...}|
|00001af0| 0d 0a 0d 0a 20 20 20 2f | 2f 20 54 68 65 20 6c 61 |.... /|/ The la|
|00001b00| 79 6f 75 74 20 77 69 6c | 6c 20 63 61 6c 6c 20 74 |yout wil|l call t|
|00001b10| 68 69 73 20 74 6f 20 67 | 65 74 20 74 68 65 20 70 |his to g|et the p|
|00001b20| 72 65 66 65 72 72 65 64 | 20 73 69 7a 65 0d 0a 20 |referred| size.. |
|00001b30| 20 20 2f 2f 20 6f 66 20 | 74 68 65 20 64 69 61 6c | // of |the dial|
|00001b40| 6f 67 2e 20 20 4d 61 6b | 65 20 69 74 20 62 69 67 |og. Mak|e it big|
|00001b50| 20 65 6e 6f 75 67 68 20 | 66 6f 72 20 74 68 65 20 | enough |for the |
|00001b60| 6c 69 73 74 62 6f 78 20 | 74 65 78 74 0d 0a 20 20 |listbox |text.. |
|00001b70| 20 2f 2f 20 74 68 65 20 | 63 68 65 63 6b 62 6f 78 | // the |checkbox|
|00001b80| 65 73 2c 20 63 61 6e 76 | 61 73 2c 20 61 6e 64 20 |es, canv|as, and |
|00001b90| 62 75 74 74 6f 6e 73 2e | 2e 2e 0d 0a 20 20 20 70 |buttons.|.... p|
|00001ba0| 75 62 6c 69 63 20 44 69 | 6d 65 6e 73 69 6f 6e 20 |ublic Di|mension |
|00001bb0| 70 72 65 66 65 72 72 65 | 64 53 69 7a 65 28 29 20 |preferre|dSize() |
|00001bc0| 7b 0d 0a 20 20 20 20 20 | 20 2f 2f 20 47 65 74 20 |{.. | // Get |
|00001bd0| 74 68 65 20 6d 65 74 72 | 69 63 73 20 6f 66 20 74 |the metr|ics of t|
|00001be0| 68 65 20 63 75 72 72 65 | 6e 74 20 66 6f 6e 74 2e |he curre|nt font.|
|00001bf0| 2e 2e 0d 0a 20 20 20 20 | 20 20 46 6f 6e 74 4d 65 |.... | FontMe|
|00001c00| 74 72 69 63 73 20 66 6d | 20 3d 20 67 65 74 46 6f |trics fm| = getFo|
|00001c10| 6e 74 4d 65 74 72 69 63 | 73 28 67 65 74 46 6f 6e |ntMetric|s(getFon|
|00001c20| 74 28 29 29 3b 0d 0a 20 | 20 20 20 20 20 69 6e 74 |t());.. | int|
|00001c30| 20 77 69 64 74 68 20 3d | 20 33 20 2a 20 66 6d 2e | width =| 3 * fm.|
|00001c40| 73 74 72 69 6e 67 57 69 | 64 74 68 28 22 48 69 67 |stringWi|dth("Hig|
|00001c50| 68 6c 69 67 68 74 65 64 | 20 66 6f 72 65 67 72 6f |hlighted| foregro|
|00001c60| 75 6e 64 22 29 3b 0d 0a | 20 20 20 20 20 20 69 6e |und");..| in|
|00001c70| 74 20 68 65 69 67 68 74 | 20 3d 20 32 34 20 2a 20 |t height| = 24 * |
|00001c80| 66 6d 2e 67 65 74 48 65 | 69 67 68 74 28 29 3b 0d |fm.getHe|ight();.|
|00001c90| 0a 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 6e 65 |. r|eturn ne|
|00001ca0| 77 20 44 69 6d 65 6e 73 | 69 6f 6e 28 77 69 64 74 |w Dimens|ion(widt|
|00001cb0| 68 2c 68 65 69 67 68 74 | 29 3b 0d 0a 20 20 20 7d |h,height|);.. }|
|00001cc0| 0d 0a 0d 0a 20 20 20 2f | 2f 20 43 72 65 61 74 65 |.... /|/ Create|
|00001cd0| 20 74 68 65 20 6d 61 69 | 6e 20 64 69 73 70 6c 61 | the mai|n displa|
|00001ce0| 79 20 70 61 6e 65 6c 2e | 2e 2e 0d 0a 20 20 20 76 |y panel.|.... v|
|00001cf0| 6f 69 64 20 63 72 65 61 | 74 65 43 6f 6d 70 6f 6e |oid crea|teCompon|
|00001d00| 65 6e 74 73 28 29 20 7b | 0d 0a 20 20 20 20 2f 2f |ents() {|.. //|
|00001d10| 20 55 73 65 20 67 72 69 | 64 62 61 67 20 63 6f 6e | Use gri|dbag con|
|00001d20| 73 74 72 61 69 6e 74 73 | 2e 2e 2e 0d 0a 20 20 20 |straints|..... |
|00001d30| 20 47 72 69 64 42 61 67 | 4c 61 79 6f 75 74 20 67 | GridBag|Layout g|
|00001d40| 20 3d 20 6e 65 77 20 47 | 72 69 64 42 61 67 4c 61 | = new G|ridBagLa|
|00001d50| 79 6f 75 74 28 29 3b 0d | 0a 20 20 20 20 73 65 74 |yout();.|. set|
|00001d60| 4c 61 79 6f 75 74 28 67 | 29 3b 0d 0a 09 20 47 72 |Layout(g|);... Gr|
|00001d70| 69 64 42 61 67 43 6f 6e | 73 74 72 61 69 6e 74 73 |idBagCon|straints|
|00001d80| 20 67 62 63 20 3d 20 6e | 65 77 20 47 72 69 64 42 | gbc = n|ew GridB|
|00001d90| 61 67 43 6f 6e 73 74 72 | 61 69 6e 74 73 28 29 3b |agConstr|aints();|
|00001da0| 0d 0a 20 20 20 20 2f 2f | 20 53 65 74 20 74 68 65 |.. //| Set the|
|00001db0| 20 63 6f 6e 73 74 72 61 | 69 6e 74 73 20 66 6f 72 | constra|ints for|
|00001dc0| 20 74 68 65 20 74 6f 70 | 20 6f 62 6a 65 63 74 73 | the top| objects|
|00001dd0| 2e 2e 2e 0d 0a 09 20 67 | 62 63 2e 66 69 6c 6c 20 |...... g|bc.fill |
|00001de0| 3d 20 47 72 69 64 42 61 | 67 43 6f 6e 73 74 72 61 |= GridBa|gConstra|
|00001df0| 69 6e 74 73 2e 42 4f 54 | 48 3b 0d 0a 09 20 67 62 |ints.BOT|H;... gb|
|00001e00| 63 2e 77 65 69 67 68 74 | 78 20 3d 20 31 2e 30 3b |c.weight|x = 1.0;|
|00001e10| 0d 0a 09 20 67 62 63 2e | 77 65 69 67 68 74 79 20 |... gbc.|weighty |
|00001e20| 3d 20 31 2e 30 3b 0d 0a | 09 20 67 62 63 2e 67 72 |= 1.0;..|. gbc.gr|
|00001e30| 69 64 68 65 69 67 68 74 | 20 3d 20 31 30 3b 0d 0a |idheight| = 10;..|
|00001e40| 0d 0a 20 20 20 20 2f 2f | 20 41 64 64 20 74 68 65 |.. //| Add the|
|00001e50| 20 6c 69 73 74 62 6f 78 | 20 6f 66 20 63 68 6f 69 | listbox| of choi|
|00001e60| 63 65 73 2e 2e 2e 0d 0a | 20 20 20 20 63 68 6f 69 |ces.....| choi|
|00001e70| 63 65 4c 69 73 74 20 3d | 20 6e 65 77 20 4c 69 73 |ceList =| new Lis|
|00001e80| 74 28 29 3b 0d 0a 20 20 | 20 20 63 68 6f 69 63 65 |t();.. | choice|
|00001e90| 4c 69 73 74 2e 61 64 64 | 49 74 65 6d 28 22 4e 6f |List.add|Item("No|
|00001ea0| 72 6d 61 6c 20 66 6f 72 | 65 67 72 6f 75 6e 64 22 |rmal for|eground"|
|00001eb0| 29 3b 0d 0a 20 20 20 20 | 63 68 6f 69 63 65 4c 69 |);.. |choiceLi|
|00001ec0| 73 74 2e 61 64 64 49 74 | 65 6d 28 22 4e 6f 72 6d |st.addIt|em("Norm|
|00001ed0| 61 6c 20 62 61 63 6b 67 | 72 6f 75 6e 64 22 29 3b |al backg|round");|
|00001ee0| 0d 0a 20 20 20 20 63 68 | 6f 69 63 65 4c 69 73 74 |.. ch|oiceList|
|00001ef0| 2e 61 64 64 49 74 65 6d | 28 22 48 69 67 68 6c 69 |.addItem|("Highli|
|00001f00| 67 68 74 65 64 20 66 6f | 72 65 67 72 6f 75 6e 64 |ghted fo|reground|
|00001f10| 22 29 3b 0d 0a 20 20 20 | 20 63 68 6f 69 63 65 4c |");.. | choiceL|
|00001f20| 69 73 74 2e 61 64 64 49 | 74 65 6d 28 22 48 69 67 |ist.addI|tem("Hig|
|00001f30| 68 6c 69 67 68 74 65 64 | 20 62 61 63 6b 67 72 6f |hlighted| backgro|
|00001f40| 75 6e 64 22 29 3b 0d 0a | 09 67 2e 73 65 74 43 6f |und");..|.g.setCo|
|00001f50| 6e 73 74 72 61 69 6e 74 | 73 28 63 68 6f 69 63 65 |nstraint|s(choice|
|00001f60| 4c 69 73 74 2c 67 62 63 | 29 3b 0d 0a 09 61 64 64 |List,gbc|);...add|
|00001f70| 28 63 68 6f 69 63 65 4c | 69 73 74 29 3b 0d 0a 20 |(choiceL|ist);.. |
|00001f80| 20 20 20 2f 2f 20 41 64 | 64 20 74 68 65 20 6c 69 | // Ad|d the li|
|00001f90| 73 74 65 6e 65 72 73 2e | 2e 2e 0d 0a 20 20 20 20 |steners.|.... |
|00001fa0| 43 6f 6c 6f 72 4c 69 73 | 74 62 6f 78 4c 69 73 74 |ColorLis|tboxList|
|00001fb0| 65 6e 65 72 20 6c 69 73 | 74 4c 69 73 74 65 6e 65 |ener lis|tListene|
|00001fc0| 72 20 3d 20 6e 65 77 20 | 43 6f 6c 6f 72 4c 69 73 |r = new |ColorLis|
|00001fd0| 74 62 6f 78 4c 69 73 74 | 65 6e 65 72 28 74 68 69 |tboxList|ener(thi|
|00001fe0| 73 29 3b 0d 0a 20 20 20 | 20 63 68 6f 69 63 65 4c |s);.. | choiceL|
|00001ff0| 69 73 74 2e 61 64 64 49 | 74 65 6d 4c 69 73 74 65 |ist.addI|temListe|
|00002000| 6e 65 72 28 6c 69 73 74 | 4c 69 73 74 65 6e 65 72 |ner(list|Listener|
|00002010| 29 3b 0d 0a 0d 0a 20 20 | 20 20 2f 2f 20 43 72 65 |);.... | // Cre|
|00002020| 61 74 65 20 74 68 65 20 | 63 68 65 63 6b 62 6f 78 |ate the |checkbox|
|00002030| 20 70 61 6e 65 6c 0d 0a | 20 20 20 20 50 61 6e 65 | panel..| Pane|
|00002040| 6c 20 63 68 65 63 6b 62 | 6f 78 50 61 6e 65 6c 20 |l checkb|oxPanel |
|00002050| 3d 20 6e 65 77 20 50 61 | 6e 65 6c 28 29 3b 0d 0a |= new Pa|nel();..|
|00002060| 20 20 20 20 63 68 65 63 | 6b 62 6f 78 50 61 6e 65 | chec|kboxPane|
|00002070| 6c 2e 73 65 74 4c 61 79 | 6f 75 74 28 6e 65 77 20 |l.setLay|out(new |
|00002080| 47 72 69 64 4c 61 79 6f | 75 74 28 31 32 2c 31 29 |GridLayo|ut(12,1)|
|00002090| 29 3b 0d 0a 20 20 20 20 | 2f 2f 20 43 72 65 61 74 |);.. |// Creat|
|000020a0| 65 20 74 68 65 20 63 68 | 65 63 6b 62 6f 78 20 67 |e the ch|eckbox g|
|000020b0| 72 6f 75 70 20 61 6e 64 | 20 61 64 64 20 72 61 64 |roup and| add rad|
|000020c0| 69 6f 20 62 75 74 74 6f | 6e 73 2e 2e 2e 0d 0a 20 |io butto|ns..... |
|000020d0| 20 20 20 63 6f 6c 6f 72 | 47 72 70 20 3d 20 6e 65 | color|Grp = ne|
|000020e0| 77 20 43 6f 6c 6f 72 65 | 64 43 68 65 63 6b 62 6f |w Colore|dCheckbo|
|000020f0| 78 47 72 6f 75 70 28 63 | 68 65 63 6b 62 6f 78 50 |xGroup(c|heckboxP|
|00002100| 61 6e 65 6c 2c 6e 65 77 | 20 43 6f 6c 6f 72 43 68 |anel,new| ColorCh|
|00002110| 65 63 6b 62 6f 78 4c 69 | 73 74 65 6e 65 72 28 74 |eckboxLi|stener(t|
|00002120| 68 69 73 29 29 3b 0d 0a | 20 20 20 20 63 6f 6c 6f |his));..| colo|
|00002130| 72 47 72 70 2e 73 65 74 | 4d 61 74 63 68 69 6e 67 |rGrp.set|Matching|
|00002140| 43 6f 6c 6f 72 28 43 6f | 6c 6f 72 2e 6d 61 67 65 |Color(Co|lor.mage|
|00002150| 6e 74 61 29 3b 0d 0a 0d | 0a 20 20 20 20 2f 2f 20 |nta);...|. // |
|00002160| 43 72 65 61 74 65 20 61 | 64 64 20 63 68 65 63 6b |Create a|dd check|
|00002170| 62 6f 78 20 70 61 6e 65 | 6c 20 74 6f 20 72 69 67 |box pane|l to rig|
|00002180| 68 74 2e 2e 2e 0d 0a 09 | 67 62 63 2e 67 72 69 64 |ht......|gbc.grid|
|00002190| 77 69 64 74 68 20 3d 20 | 47 72 69 64 42 61 67 43 |width = |GridBagC|
|000021a0| 6f 6e 73 74 72 61 69 6e | 74 73 2e 52 45 4d 41 49 |onstrain|ts.REMAI|
|000021b0| 4e 44 45 52 3b 0d 0a 09 | 67 2e 73 65 74 43 6f 6e |NDER;...|g.setCon|
|000021c0| 73 74 72 61 69 6e 74 73 | 28 63 68 65 63 6b 62 6f |straints|(checkbo|
|000021d0| 78 50 61 6e 65 6c 2c 67 | 62 63 29 3b 0d 0a 09 61 |xPanel,g|bc);...a|
|000021e0| 64 64 28 63 68 65 63 6b | 62 6f 78 50 61 6e 65 6c |dd(check|boxPanel|
|000021f0| 29 3b 0d 0a 0d 0a 20 20 | 20 20 2f 2f 20 44 69 73 |);.... | // Dis|
|00002200| 70 6c 61 79 20 74 68 65 | 20 63 6f 6c 6f 72 20 63 |play the| color c|
|00002210| 68 6f 73 65 6e 2e 2e 2e | 0d 0a 20 20 20 20 64 20 |hosen...|.. d |
|00002220| 3d 20 6e 65 77 20 63 6f | 6c 6f 72 44 69 73 70 6c |= new co|lorDispl|
|00002230| 61 79 28 22 54 68 69 73 | 20 69 73 20 68 6f 77 20 |ay("This| is how |
|00002240| 74 68 65 20 74 65 78 74 | 20 6c 6f 6f 6b 73 2e 22 |the text| looks."|
|00002250| 29 3b 0d 0a 0d 0a 20 20 | 20 20 2f 2f 20 41 64 64 |);.... | // Add|
|00002260| 20 74 6f 20 67 72 69 64 | 20 62 61 67 2e 2e 2e 0d | to grid| bag....|
|00002270| 0a 09 67 62 63 2e 77 65 | 69 67 68 74 79 20 3d 20 |..gbc.we|ighty = |
|00002280| 30 2e 30 3b 0d 0a 09 67 | 62 63 2e 77 65 69 67 68 |0.0;...g|bc.weigh|
|00002290| 74 78 20 3d 20 31 2e 30 | 3b 0d 0a 09 67 62 63 2e |tx = 1.0|;...gbc.|
|000022a0| 67 72 69 64 77 69 64 74 | 68 20 3d 20 47 72 69 64 |gridwidt|h = Grid|
|000022b0| 42 61 67 43 6f 6e 73 74 | 72 61 69 6e 74 73 2e 52 |BagConst|raints.R|
|000022c0| 45 4d 41 49 4e 44 45 52 | 3b 0d 0a 09 67 62 63 2e |EMAINDER|;...gbc.|
|000022d0| 67 72 69 64 68 65 69 67 | 68 74 20 3d 20 31 3b 0d |gridheig|ht = 1;.|
|000022e0| 0a 09 67 2e 73 65 74 43 | 6f 6e 73 74 72 61 69 6e |..g.setC|onstrain|
|000022f0| 74 73 28 64 2c 67 62 63 | 29 3b 0d 0a 20 20 20 20 |ts(d,gbc|);.. |
|00002300| 61 64 64 28 64 29 3b 0d | 0a 0d 0a 20 20 20 20 2f |add(d);.|... /|
|00002310| 2f 20 54 77 6f 20 62 75 | 74 74 6f 6e 73 3a 20 22 |/ Two bu|ttons: "|
|00002320| 55 70 64 61 74 65 22 20 | 61 6e 64 20 22 43 61 6e |Update" |and "Can|
|00002330| 63 65 6c 22 0d 0a 20 20 | 20 20 50 61 6e 65 6c 20 |cel".. | Panel |
|00002340| 70 20 3d 20 6e 65 77 20 | 50 61 6e 65 6c 28 29 3b |p = new |Panel();|
|00002350| 0d 0a 20 20 20 20 43 68 | 6f 6f 73 65 41 63 74 69 |.. Ch|ooseActi|
|00002360| 6f 6e 4c 69 73 74 65 6e | 65 72 20 6c 69 73 74 65 |onListen|er liste|
|00002370| 6e 65 72 20 3d 20 6e 65 | 77 20 43 68 6f 6f 73 65 |ner = ne|w Choose|
|00002380| 41 63 74 69 6f 6e 4c 69 | 73 74 65 6e 65 72 28 74 |ActionLi|stener(t|
|00002390| 68 69 73 29 3b 0d 0a 20 | 20 20 20 42 75 74 74 6f |his);.. | Butto|
|000023a0| 6e 20 62 20 3d 20 6e 65 | 77 20 42 75 74 74 6f 6e |n b = ne|w Button|
|000023b0| 28 22 55 70 64 61 74 65 | 22 29 3b 0d 0a 20 20 20 |("Update|");.. |
|000023c0| 20 62 2e 61 64 64 41 63 | 74 69 6f 6e 4c 69 73 74 | b.addAc|tionList|
|000023d0| 65 6e 65 72 28 6c 69 73 | 74 65 6e 65 72 29 3b 0d |ener(lis|tener);.|
|000023e0| 0a 20 20 20 20 70 2e 61 | 64 64 28 62 29 3b 0d 0a |. p.a|dd(b);..|
|000023f0| 20 20 20 20 62 20 3d 20 | 6e 65 77 20 42 75 74 74 | b = |new Butt|
|00002400| 6f 6e 28 22 43 61 6e 63 | 65 6c 22 29 3b 0d 0a 20 |on("Canc|el");.. |
|00002410| 20 20 20 62 2e 61 64 64 | 41 63 74 69 6f 6e 4c 69 | b.add|ActionLi|
|00002420| 73 74 65 6e 65 72 28 6c | 69 73 74 65 6e 65 72 29 |stener(l|istener)|
|00002430| 3b 0d 0a 20 20 20 20 70 | 2e 61 64 64 28 62 29 3b |;.. p|.add(b);|
|00002440| 0d 0a 0d 0a 20 20 20 20 | 2f 2f 20 41 64 64 20 74 |.... |// Add t|
|00002450| 6f 20 67 72 69 64 20 62 | 61 67 2e 2e 2e 0d 0a 09 |o grid b|ag......|
|00002460| 67 62 63 2e 67 72 69 64 | 77 69 64 74 68 20 3d 20 |gbc.grid|width = |
|00002470| 47 72 69 64 42 61 67 43 | 6f 6e 73 74 72 61 69 6e |GridBagC|onstrain|
|00002480| 74 73 2e 52 45 4d 41 49 | 4e 44 45 52 3b 0d 0a 09 |ts.REMAI|NDER;...|
|00002490| 67 2e 73 65 74 43 6f 6e | 73 74 72 61 69 6e 74 73 |g.setCon|straints|
|000024a0| 28 70 2c 67 62 63 29 3b | 0d 0a 20 20 20 20 61 64 |(p,gbc);|.. ad|
|000024b0| 64 28 70 29 3b 0d 0a 0d | 0a 20 20 20 7d 0d 0a 0d |d(p);...|. }...|
|000024c0| 0a 09 2f 2f 20 53 65 74 | 75 70 20 64 65 66 61 75 |..// Set|up defau|
|000024d0| 6c 74 73 20 75 70 6f 6e | 20 73 68 6f 77 69 6e 67 |lts upon| showing|
|000024e0| 2e 2e 2e 0d 0a 09 70 75 | 62 6c 69 63 20 73 79 6e |......pu|blic syn|
|000024f0| 63 68 72 6f 6e 69 7a 65 | 64 20 76 6f 69 64 20 73 |chronize|d void s|
|00002500| 68 6f 77 28 29 20 7b 0d | 0a 09 20 20 73 75 70 65 |how() {.|.. supe|
|00002510| 72 2e 73 68 6f 77 28 29 | 3b 20 2f 2f 20 43 61 6c |r.show()|; // Cal|
|00002520| 6c 20 74 68 65 20 64 65 | 66 61 75 6c 74 20 73 68 |l the de|fault sh|
|00002530| 6f 77 20 6d 65 74 68 6f | 64 2e 2e 2e 0d 0a 20 20 |ow metho|d..... |
|00002540| 20 20 20 20 2f 2f 20 53 | 65 74 20 74 68 65 20 6c | // S|et the l|
|00002550| 69 73 74 62 6f 78 20 64 | 65 66 61 75 6c 74 2e 2e |istbox d|efault..|
|00002560| 2e 0d 0a 20 20 20 20 20 | 20 63 68 6f 69 63 65 4c |... | choiceL|
|00002570| 69 73 74 2e 73 65 6c 65 | 63 74 28 30 29 3b 0d 0a |ist.sele|ct(0);..|
|00002580| 20 20 20 20 20 20 2f 2f | 20 53 65 74 20 75 70 20 | //| Set up |
|00002590| 63 61 70 74 69 6f 6e 20 | 63 6f 6c 6f 72 73 20 61 |caption |colors a|
|000025a0| 6e 64 20 63 6f 6c 6f 72 | 20 63 68 6f 69 63 65 20 |nd color| choice |
|000025b0| 68 69 67 68 6c 69 67 68 | 74 2e 2e 2e 0d 0a 20 20 |highligh|t..... |
|000025c0| 20 20 20 20 73 65 6c 65 | 63 74 65 64 43 68 6f 69 | sele|ctedChoi|
|000025d0| 63 65 4c 69 73 74 49 74 | 65 6d 28 29 3b 0d 0a 09 |ceListIt|em();...|
|000025e0| 7d 0d 0a 0d 0a 20 20 20 | 2f 2f 20 55 70 64 61 74 |}.... |// Updat|
|000025f0| 65 20 74 68 65 20 67 6c | 6f 62 61 6c 20 63 6f 6c |e the gl|obal col|
|00002600| 6f 72 20 66 69 65 6c 64 | 73 20 77 69 74 68 20 63 |or field|s with c|
|00002610| 75 72 72 65 6e 74 20 73 | 65 74 74 69 6e 67 73 2e |urrent s|ettings.|
|00002620| 2e 2e 0d 0a 20 20 20 70 | 75 62 6c 69 63 20 76 6f |.... p|ublic vo|
|00002630| 69 64 20 75 70 64 61 74 | 65 28 29 0d 0a 20 20 20 |id updat|e().. |
|00002640| 7b 0d 0a 20 20 20 20 20 | 20 2f 2f 20 53 65 74 20 |{.. | // Set |
|00002650| 63 61 6e 76 61 73 20 63 | 6f 6c 6f 72 73 20 62 61 |canvas c|olors ba|
|00002660| 73 65 64 20 6f 6e 20 73 | 74 61 74 65 2e 2e 2e 0d |sed on s|tate....|
|00002670| 0a 20 20 20 20 20 20 69 | 6e 74 20 69 6e 64 65 78 |. i|nt index|
|00002680| 20 3d 20 63 68 6f 69 63 | 65 4c 69 73 74 2e 67 65 | = choic|eList.ge|
|00002690| 74 53 65 6c 65 63 74 65 | 64 49 6e 64 65 78 28 29 |tSelecte|dIndex()|
|000026a0| 3b 0d 0a 20 20 20 20 20 | 20 73 77 69 74 63 68 20 |;.. | switch |
|000026b0| 28 69 6e 64 65 78 29 20 | 7b 0d 0a 20 20 20 20 20 |(index) |{.. |
|000026c0| 20 20 20 63 61 73 65 20 | 4e 4f 52 4d 41 4c 5f 46 | case |NORMAL_F|
|000026d0| 4f 52 45 3a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ORE:.. | |
|000026e0| 20 20 6e 6f 72 6d 61 6c | 46 6f 72 65 43 6f 6c 6f | normal|ForeColo|
|000026f0| 72 20 3d 20 64 2e 67 65 | 74 46 6f 72 65 43 6f 6c |r = d.ge|tForeCol|
|00002700| 6f 72 28 29 3b 0d 0a 20 | 20 20 20 20 20 20 20 20 |or();.. | |
|00002710| 20 20 20 62 72 65 61 6b | 3b 0d 0a 20 20 20 20 20 | break|;.. |
|00002720| 20 20 20 63 61 73 65 20 | 4e 4f 52 4d 41 4c 5f 42 | case |NORMAL_B|
|00002730| 41 43 4b 3a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ACK:.. | |
|00002740| 20 20 6e 6f 72 6d 61 6c | 42 61 63 6b 43 6f 6c 6f | normal|BackColo|
|00002750| 72 20 3d 20 64 2e 67 65 | 74 42 61 63 6b 43 6f 6c |r = d.ge|tBackCol|
|00002760| 6f 72 28 29 3b 0d 0a 20 | 20 20 20 20 20 20 20 20 |or();.. | |
|00002770| 20 20 20 62 72 65 61 6b | 3b 0d 0a 20 20 20 20 20 | break|;.. |
|00002780| 20 20 20 63 61 73 65 20 | 48 49 4c 49 54 45 5f 46 | case |HILITE_F|
|00002790| 4f 52 45 3a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ORE:.. | |
|000027a0| 20 20 68 69 67 68 6c 69 | 67 68 74 65 64 46 6f 72 | highli|ghtedFor|
|000027b0| 65 43 6f 6c 6f 72 20 3d | 20 64 2e 67 65 74 46 6f |eColor =| d.getFo|
|000027c0| 72 65 43 6f 6c 6f 72 28 | 29 3b 0d 0a 20 20 20 20 |reColor(|);.. |
|000027d0| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0d 0a | |break;..|
|000027e0| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 48 49 4c | |case HIL|
|000027f0| 49 54 45 5f 42 41 43 4b | 3a 0d 0a 20 20 20 20 20 |ITE_BACK|:.. |
|00002800| 20 20 20 20 20 20 20 68 | 69 67 68 6c 69 67 68 74 | h|ighlight|
|00002810| 65 64 42 61 63 6b 43 6f | 6c 6f 72 20 3d 20 64 2e |edBackCo|lor = d.|
|00002820| 67 65 74 42 61 63 6b 43 | 6f 6c 6f 72 28 29 3b 0d |getBackC|olor();.|
|00002830| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 62 72 65 |. | bre|
|00002840| 61 6b 3b 0d 0a 20 20 20 | 20 20 20 20 20 64 65 66 |ak;.. | def|
|00002850| 61 75 6c 74 3a 0d 0a 20 | 20 20 20 20 20 20 20 20 |ault:.. | |
|00002860| 20 20 20 62 72 65 61 6b | 3b 0d 0a 20 20 20 20 20 | break|;.. |
|00002870| 20 7d 20 0d 0a 20 20 20 | 7d 0d 0a 0d 0a 20 20 20 | } .. |}.... |
|00002880| 2f 2f 20 53 65 74 20 75 | 70 20 63 61 70 74 69 6f |// Set u|p captio|
|00002890| 6e 20 63 6f 6c 6f 72 73 | 20 61 6e 64 20 63 6f 6c |n colors| and col|
|000028a0| 6f 72 20 63 68 6f 69 63 | 65 20 68 69 67 68 6c 69 |or choic|e highli|
|000028b0| 67 68 74 0d 0a 20 20 20 | 2f 2f 20 61 63 63 6f 72 |ght.. |// accor|
|000028c0| 64 69 6e 67 20 74 6f 20 | 63 75 72 72 65 6e 74 20 |ding to |current |
|000028d0| 6c 69 73 74 62 6f 78 20 | 76 61 6c 75 65 2e 2e 2e |listbox |value...|
|000028e0| 0d 0a 20 20 20 70 75 62 | 6c 69 63 20 76 6f 69 64 |.. pub|lic void|
|000028f0| 20 73 65 6c 65 63 74 65 | 64 43 68 6f 69 63 65 4c | selecte|dChoiceL|
|00002900| 69 73 74 49 74 65 6d 28 | 29 20 7b 0d 0a 20 20 20 |istItem(|) {.. |
|00002910| 20 20 20 43 6f 6c 6f 72 | 20 66 6f 72 65 2c 62 61 | Color| fore,ba|
|00002920| 63 6b 3b 20 20 2f 2f 20 | 44 69 73 70 6c 61 79 20 |ck; // |Display |
|00002930| 63 61 6e 76 61 73 20 63 | 6f 6c 6f 72 73 0d 0a 20 |canvas c|olors.. |
|00002940| 20 20 20 20 20 2f 2f 20 | 53 65 74 20 63 61 6e 76 | // |Set canv|
|00002950| 61 73 20 63 6f 6c 6f 72 | 73 20 62 61 73 65 64 20 |as color|s based |
|00002960| 6f 6e 20 73 74 61 74 65 | 2e 2e 2e 0d 0a 20 20 20 |on state|..... |
|00002970| 20 20 20 69 6e 74 20 69 | 6e 64 65 78 20 3d 20 63 | int i|ndex = c|
|00002980| 68 6f 69 63 65 4c 69 73 | 74 2e 67 65 74 53 65 6c |hoiceLis|t.getSel|
|00002990| 65 63 74 65 64 49 6e 64 | 65 78 28 29 3b 0d 0a 20 |ectedInd|ex();.. |
|000029a0| 20 20 20 20 20 69 66 20 | 28 28 69 6e 64 65 78 20 | if |((index |
|000029b0| 3d 3d 20 4e 4f 52 4d 41 | 4c 5f 46 4f 52 45 29 20 |== NORMA|L_FORE) |
|000029c0| 7c 7c 20 28 69 6e 64 65 | 78 20 3d 3d 20 4e 4f 52 ||| (inde|x == NOR|
|000029d0| 4d 41 4c 5f 42 41 43 4b | 29 29 20 7b 0d 0a 20 20 |MAL_BACK|)) {.. |
|000029e0| 20 20 20 20 20 20 20 66 | 6f 72 65 20 3d 20 6e 6f | f|ore = no|
|000029f0| 72 6d 61 6c 46 6f 72 65 | 43 6f 6c 6f 72 3b 0d 0a |rmalFore|Color;..|
|00002a00| 20 20 20 20 20 20 20 20 | 20 62 61 63 6b 20 3d 20 | | back = |
|00002a10| 6e 6f 72 6d 61 6c 42 61 | 63 6b 43 6f 6c 6f 72 3b |normalBa|ckColor;|
|00002a20| 0d 0a 20 20 20 20 20 20 | 7d 0d 0a 20 20 20 20 20 |.. |}.. |
|00002a30| 20 2f 2f 20 4f 74 68 65 | 72 77 69 73 65 20 69 74 | // Othe|rwise it|
|00002a40| 73 20 74 68 65 20 62 61 | 63 6b 67 72 6f 75 6e 64 |s the ba|ckground|
|00002a50| 2e 2e 2e 0d 0a 20 20 20 | 20 20 20 65 6c 73 65 20 |..... | else |
|00002a60| 7b 0d 0a 20 20 20 20 20 | 20 20 20 20 66 6f 72 65 |{.. | fore|
|00002a70| 20 3d 20 68 69 67 68 6c | 69 67 68 74 65 64 46 6f | = highl|ightedFo|
|00002a80| 72 65 43 6f 6c 6f 72 3b | 0d 0a 20 20 20 20 20 20 |reColor;|.. |
|00002a90| 20 20 20 62 61 63 6b 20 | 3d 20 68 69 67 68 6c 69 | back |= highli|
|00002aa0| 67 68 74 65 64 42 61 63 | 6b 43 6f 6c 6f 72 3b 0d |ghtedBac|kColor;.|
|00002ab0| 0a 20 20 20 20 20 20 7d | 0d 0a 20 20 20 20 20 20 |. }|.. |
|00002ac0| 2f 2f 20 55 70 64 61 74 | 65 20 74 68 65 20 63 61 |// Updat|e the ca|
|00002ad0| 6e 76 61 73 2e 2e 2e 0d | 0a 20 20 20 20 20 20 64 |nvas....|. d|
|00002ae0| 2e 73 65 74 46 6f 72 65 | 43 6f 6c 6f 72 28 66 6f |.setFore|Color(fo|
|00002af0| 72 65 29 3b 0d 0a 20 20 | 20 20 20 20 64 2e 73 65 |re);.. | d.se|
|00002b00| 74 42 61 63 6b 43 6f 6c | 6f 72 28 62 61 63 6b 29 |tBackCol|or(back)|
|00002b10| 3b 0d 0a 20 20 20 20 20 | 20 64 2e 72 65 70 61 69 |;.. | d.repai|
|00002b20| 6e 74 28 29 3b 0d 0a 20 | 20 20 20 20 20 2f 2f 20 |nt();.. | // |
|00002b30| 55 70 64 61 74 65 20 74 | 68 65 20 63 6f 6c 6f 72 |Update t|he color|
|00002b40| 20 72 61 64 69 6f 20 62 | 75 74 74 6f 6e 73 2e 2e | radio b|uttons..|
|00002b50| 2e 0d 0a 20 20 20 20 20 | 20 43 6f 6c 6f 72 20 72 |... | Color r|
|00002b60| 61 64 69 6f 43 6f 6c 6f | 72 3b 0d 0a 20 20 20 20 |adioColo|r;.. |
|00002b70| 20 20 2f 2f 20 45 76 65 | 6e 20 6e 75 6d 62 65 72 | // Eve|n number|
|00002b80| 73 20 61 72 65 20 66 6f | 72 65 2c 20 6f 64 64 20 |s are fo|re, odd |
|00002b90| 61 72 65 20 62 61 63 6b | 2e 2e 2e 0d 0a 20 20 20 |are back|..... |
|00002ba0| 20 20 20 69 66 20 28 28 | 69 6e 64 65 78 20 25 20 | if ((|index % |
|00002bb0| 32 29 20 3d 3d 20 30 29 | 0d 0a 20 20 20 20 20 20 |2) == 0)|.. |
|00002bc0| 20 20 20 72 61 64 69 6f | 43 6f 6c 6f 72 20 3d 20 | radio|Color = |
|00002bd0| 66 6f 72 65 3b 0d 0a 20 | 20 20 20 20 20 65 6c 73 |fore;.. | els|
|00002be0| 65 0d 0a 20 20 20 20 20 | 20 20 20 20 72 61 64 69 |e.. | radi|
|00002bf0| 6f 43 6f 6c 6f 72 20 3d | 20 62 61 63 6b 3b 0d 0a |oColor =| back;..|
|00002c00| 20 20 20 20 20 20 63 6f | 6c 6f 72 47 72 70 2e 73 | co|lorGrp.s|
|00002c10| 65 74 4d 61 74 63 68 69 | 6e 67 43 6f 6c 6f 72 28 |etMatchi|ngColor(|
|00002c20| 72 61 64 69 6f 43 6f 6c | 6f 72 29 3b 0d 0a 20 20 |radioCol|or);.. |
|00002c30| 20 7d 0d 0a 0d 0a 20 0d | 0a 20 20 20 2f 2f 20 55 | }.... .|. // U|
|00002c40| 70 64 61 74 65 20 64 69 | 73 70 6c 61 79 20 63 61 |pdate di|splay ca|
|00002c50| 6e 76 61 73 20 77 68 65 | 6e 20 72 61 64 69 6f 20 |nvas whe|n radio |
|00002c60| 63 6f 6c 6f 72 20 63 68 | 61 6e 67 65 73 2e 2e 2e |color ch|anges...|
|00002c70| 0d 0a 20 20 20 70 75 62 | 6c 69 63 20 76 6f 69 64 |.. pub|lic void|
|00002c80| 20 73 65 6c 65 63 74 65 | 64 52 61 64 69 6f 49 74 | selecte|dRadioIt|
|00002c90| 65 6d 28 29 20 7b 0d 0a | 20 20 20 20 20 20 2f 2f |em() {..| //|
|00002ca0| 20 47 65 74 20 63 68 6f | 69 63 65 20 66 72 6f 6d | Get cho|ice from|
|00002cb0| 20 43 6f 6c 6f 72 20 62 | 6f 78 2e 2e 2e 0d 0a 20 | Color b|ox..... |
|00002cc0| 20 20 20 20 20 43 6f 6c | 6f 72 65 64 43 68 65 63 | Col|oredChec|
|00002cd0| 6b 62 6f 78 20 62 6f 78 | 20 3d 20 28 43 6f 6c 6f |kbox box| = (Colo|
|00002ce0| 72 65 64 43 68 65 63 6b | 62 6f 78 29 63 6f 6c 6f |redCheck|box)colo|
|00002cf0| 72 47 72 70 2e 67 65 74 | 43 75 72 72 65 6e 74 28 |rGrp.get|Current(|
|00002d00| 29 3b 0d 0a 20 20 20 20 | 20 20 43 6f 6c 6f 72 20 |);.. | Color |
|00002d10| 63 6f 6c 6f 72 20 3d 20 | 62 6f 78 2e 67 65 74 43 |color = |box.getC|
|00002d20| 6f 6c 6f 72 28 29 3b 0d | 0a 20 20 20 20 20 20 2f |olor();.|. /|
|00002d30| 2f 20 49 66 20 6e 6f 72 | 6d 61 6c 20 73 65 74 20 |/ If nor|mal set |
|00002d40| 63 61 6e 76 61 73 20 63 | 6f 6c 6f 72 73 2e 2e 2e |canvas c|olors...|
|00002d50| 0d 0a 20 20 20 20 20 20 | 43 6f 6c 6f 72 20 66 6f |.. |Color fo|
|00002d60| 72 65 2c 62 61 63 6b 3b | 0d 0a 20 20 20 20 20 20 |re,back;|.. |
|00002d70| 69 6e 74 20 69 6e 64 65 | 78 20 3d 20 63 68 6f 69 |int inde|x = choi|
|00002d80| 63 65 4c 69 73 74 2e 67 | 65 74 53 65 6c 65 63 74 |ceList.g|etSelect|
|00002d90| 65 64 49 6e 64 65 78 28 | 29 3b 0d 0a 20 20 20 20 |edIndex(|);.. |
|00002da0| 20 20 2f 2f 20 53 65 74 | 20 62 61 63 6b 67 72 6f | // Set| backgro|
|00002db0| 75 6e 64 20 6f 72 20 66 | 6f 72 65 67 72 6f 75 6e |und or f|oregroun|
|00002dc0| 64 20 63 6f 6c 6f 72 20 | 62 61 73 65 64 20 6f 6e |d color |based on|
|00002dd0| 0d 0a 20 20 20 20 20 20 | 2f 2f 20 63 75 72 72 65 |.. |// curre|
|00002de0| 6e 74 20 6c 69 73 74 62 | 6f 78 20 73 65 6c 65 63 |nt listb|ox selec|
|00002df0| 74 69 6f 6e 2e 2e 2e 0d | 0a 20 20 20 20 20 20 69 |tion....|. i|
|00002e00| 66 20 28 28 69 6e 64 65 | 78 20 3d 3d 20 4e 4f 52 |f ((inde|x == NOR|
|00002e10| 4d 41 4c 5f 46 4f 52 45 | 29 20 7c 7c 20 28 69 6e |MAL_FORE|) || (in|
|00002e20| 64 65 78 20 3d 3d 20 48 | 49 4c 49 54 45 5f 46 4f |dex == H|ILITE_FO|
|00002e30| 52 45 29 29 0d 0a 20 20 | 20 20 20 20 20 20 20 64 |RE)).. | d|
|00002e40| 2e 73 65 74 46 6f 72 65 | 43 6f 6c 6f 72 28 63 6f |.setFore|Color(co|
|00002e50| 6c 6f 72 29 3b 0d 0a 20 | 20 20 20 20 20 65 6c 73 |lor);.. | els|
|00002e60| 65 0d 0a 20 20 20 20 20 | 20 20 20 20 64 2e 73 65 |e.. | d.se|
|00002e70| 74 42 61 63 6b 43 6f 6c | 6f 72 28 63 6f 6c 6f 72 |tBackCol|or(color|
|00002e80| 29 3b 0d 0a 20 20 20 20 | 20 20 2f 2f 20 52 65 70 |);.. | // Rep|
|00002e90| 61 69 6e 74 20 74 68 65 | 20 63 61 6e 76 61 73 2e |aint the| canvas.|
|00002ea0| 2e 2e 0d 0a 20 20 20 20 | 20 20 64 2e 72 65 70 61 |.... | d.repa|
|00002eb0| 69 6e 74 28 29 3b 0d 0a | 20 20 20 7d 0d 0a 7d 0d |int();..| }..}.|
|00002ec0| 0a 0d 0a 2f 2f 20 41 20 | 73 6d 61 6c 6c 20 63 6c |...// A |small cl|
|00002ed0| 61 73 73 20 74 68 61 74 | 20 69 6c 6c 75 73 74 72 |ass that| illustr|
|00002ee0| 61 74 65 73 20 74 68 65 | 0d 0a 2f 2f 20 63 75 72 |ates the|..// cur|
|00002ef0| 72 65 6e 74 20 68 69 67 | 68 6c 69 67 68 74 20 61 |rent hig|hlight a|
|00002f00| 6e 64 20 62 61 63 6b 67 | 72 6f 75 6e 64 0d 0a 63 |nd backg|round..c|
|00002f10| 6c 61 73 73 20 63 6f 6c | 6f 72 44 69 73 70 6c 61 |lass col|orDispla|
|00002f20| 79 20 65 78 74 65 6e 64 | 73 20 43 61 6e 76 61 73 |y extend|s Canvas|
|00002f30| 20 7b 0d 0a 20 20 20 53 | 74 72 69 6e 67 20 64 69 | {.. S|tring di|
|00002f40| 73 70 6c 61 79 54 65 78 | 74 3b 0d 0a 20 20 20 43 |splayTex|t;.. C|
|00002f50| 6f 6c 6f 72 20 66 6f 72 | 65 67 72 6f 75 6e 64 3b |olor for|eground;|
|00002f60| 20 20 2f 2f 20 54 68 65 | 20 63 6f 6c 6f 72 73 20 | // The| colors |
|00002f70| 74 6f 20 62 65 20 64 69 | 73 70 6c 61 79 65 64 2e |to be di|splayed.|
|00002f80| 2e 2e 0d 0a 20 20 20 43 | 6f 6c 6f 72 20 62 61 63 |.... C|olor bac|
|00002f90| 6b 67 72 6f 75 6e 64 3b | 0d 0a 20 20 20 2f 2f 20 |kground;|.. // |
|00002fa0| 43 6f 6e 73 74 72 75 63 | 74 20 74 68 65 20 64 69 |Construc|t the di|
|00002fb0| 73 70 6c 61 79 20 62 79 | 20 73 74 6f 72 69 6e 67 |splay by| storing|
|00002fc0| 20 74 68 65 0d 0a 20 20 | 20 2f 2f 20 74 65 78 74 | the.. | // text|
|00002fd0| 20 74 6f 20 62 65 20 64 | 69 73 70 6c 61 79 65 64 | to be d|isplayed|
|00002fe0| 2e 2e 2e 0d 0a 20 20 20 | 70 75 62 6c 69 63 20 63 |..... |public c|
|00002ff0| 6f 6c 6f 72 44 69 73 70 | 6c 61 79 28 53 74 72 69 |olorDisp|lay(Stri|
|00003000| 6e 67 20 64 69 73 70 6c | 61 79 54 65 78 74 29 20 |ng displ|ayText) |
|00003010| 7b 0d 0a 20 20 20 20 20 | 20 73 75 70 65 72 28 29 |{.. | super()|
|00003020| 3b 0d 0a 20 20 20 20 20 | 20 74 68 69 73 2e 64 69 |;.. | this.di|
|00003030| 73 70 6c 61 79 54 65 78 | 74 20 3d 20 64 69 73 70 |splayTex|t = disp|
|00003040| 6c 61 79 54 65 78 74 3b | 0d 0a 20 20 20 20 20 20 |layText;|.. |
|00003050| 66 6f 72 65 67 72 6f 75 | 6e 64 20 3d 20 6e 75 6c |foregrou|nd = nul|
|00003060| 6c 3b 0d 0a 20 20 20 20 | 20 20 62 61 63 6b 67 72 |l;.. | backgr|
|00003070| 6f 75 6e 64 20 3d 20 6e | 75 6c 6c 3b 0d 0a 20 20 |ound = n|ull;.. |
|00003080| 20 7d 0d 0a 20 20 20 2f | 2f 20 53 65 74 20 74 68 | }.. /|/ Set th|
|00003090| 65 20 66 6f 72 65 67 72 | 6f 75 6e 64 20 61 6e 64 |e foregr|ound and|
|000030a0| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 64 69 73 70 | backgro|und disp|
|000030b0| 6c 61 79 0d 0a 20 20 20 | 70 75 62 6c 69 63 20 76 |lay.. |public v|
|000030c0| 6f 69 64 20 73 65 74 46 | 6f 72 65 43 6f 6c 6f 72 |oid setF|oreColor|
|000030d0| 28 43 6f 6c 6f 72 20 66 | 67 64 29 20 7b 0d 0a 20 |(Color f|gd) {.. |
|000030e0| 20 20 20 20 20 66 6f 72 | 65 67 72 6f 75 6e 64 20 | for|eground |
|000030f0| 3d 20 66 67 64 3b 0d 0a | 20 20 20 7d 0d 0a 20 20 |= fgd;..| }.. |
|00003100| 20 70 75 62 6c 69 63 20 | 76 6f 69 64 20 73 65 74 | public |void set|
|00003110| 42 61 63 6b 43 6f 6c 6f | 72 28 43 6f 6c 6f 72 20 |BackColo|r(Color |
|00003120| 62 67 64 29 20 7b 0d 0a | 20 20 20 20 20 20 62 61 |bgd) {..| ba|
|00003130| 63 6b 67 72 6f 75 6e 64 | 20 3d 20 62 67 64 3b 0d |ckground| = bgd;.|
|00003140| 0a 20 20 20 7d 0d 0a 20 | 20 20 70 75 62 6c 69 63 |. }.. | public|
|00003150| 20 43 6f 6c 6f 72 20 67 | 65 74 46 6f 72 65 43 6f | Color g|etForeCo|
|00003160| 6c 6f 72 28 29 20 7b 0d | 0a 20 20 20 20 20 20 72 |lor() {.|. r|
|00003170| 65 74 75 72 6e 20 66 6f | 72 65 67 72 6f 75 6e 64 |eturn fo|reground|
|00003180| 3b 0d 0a 20 20 20 7d 0d | 0a 20 20 20 70 75 62 6c |;.. }.|. publ|
|00003190| 69 63 20 43 6f 6c 6f 72 | 20 67 65 74 42 61 63 6b |ic Color| getBack|
|000031a0| 43 6f 6c 6f 72 28 29 20 | 7b 0d 0a 20 20 20 20 20 |Color() |{.. |
|000031b0| 20 72 65 74 75 72 6e 20 | 62 61 63 6b 67 72 6f 75 | return |backgrou|
|000031c0| 6e 64 3b 0d 0a 20 20 20 | 7d 0d 0a 0d 0a 20 20 20 |nd;.. |}.... |
|000031d0| 2f 2f 20 54 68 65 20 6c | 61 79 6f 75 74 20 77 69 |// The l|ayout wi|
|000031e0| 6c 6c 20 63 61 6c 6c 20 | 74 68 69 73 20 74 6f 20 |ll call |this to |
|000031f0| 67 65 74 20 74 68 65 20 | 6d 69 6e 69 6d 75 6d 20 |get the |minimum |
|00003200| 73 69 7a 65 0d 0a 20 20 | 20 2f 2f 20 6f 66 20 74 |size.. | // of t|
|00003210| 68 65 20 6f 62 6a 65 63 | 74 2e 20 20 49 6e 20 74 |he objec|t. In t|
|00003220| 68 69 73 20 63 61 73 65 | 20 77 65 20 77 61 6e 74 |his case| we want|
|00003230| 20 69 74 20 74 6f 20 62 | 65 20 61 74 0d 0a 20 20 | it to b|e at.. |
|00003240| 20 2f 2f 20 6c 65 61 73 | 74 20 62 69 67 20 65 6e | // leas|t big en|
|00003250| 6f 75 67 68 20 74 6f 20 | 66 69 74 20 74 68 65 20 |ough to |fit the |
|00003260| 64 69 73 70 6c 61 79 20 | 74 65 73 74 2e 2e 2e 0d |display |test....|
|00003270| 0a 20 20 20 70 75 62 6c | 69 63 20 44 69 6d 65 6e |. publ|ic Dimen|
|00003280| 73 69 6f 6e 20 6d 69 6e | 69 6d 75 6d 53 69 7a 65 |sion min|imumSize|
|00003290| 28 29 20 7b 0d 0a 20 20 | 20 20 20 20 2f 2f 20 47 |() {.. | // G|
|000032a0| 65 74 20 74 68 65 20 6d | 65 74 72 69 63 73 20 6f |et the m|etrics o|
|000032b0| 66 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 66 6f |f the cu|rrent fo|
|000032c0| 6e 74 2e 2e 2e 0d 0a 20 | 20 20 20 20 20 46 6f 6e |nt..... | Fon|
|000032d0| 74 4d 65 74 72 69 63 73 | 20 66 6d 20 3d 20 67 65 |tMetrics| fm = ge|
|000032e0| 74 46 6f 6e 74 4d 65 74 | 72 69 63 73 28 67 65 74 |tFontMet|rics(get|
|000032f0| 46 6f 6e 74 28 29 29 3b | 0d 0a 20 20 20 20 20 20 |Font());|.. |
|00003300| 72 65 74 75 72 6e 20 6e | 65 77 20 44 69 6d 65 6e |return n|ew Dimen|
|00003310| 73 69 6f 6e 28 66 6d 2e | 73 74 72 69 6e 67 57 69 |sion(fm.|stringWi|
|00003320| 64 74 68 28 64 69 73 70 | 6c 61 79 54 65 78 74 29 |dth(disp|layText)|
|00003330| 2c 0d 0a 20 20 20 20 20 | 20 20 20 20 32 20 2a 20 |,.. | 2 * |
|00003340| 66 6d 2e 67 65 74 48 65 | 69 67 68 74 28 29 29 3b |fm.getHe|ight());|
|00003350| 0d 0a 20 20 20 7d 0d 0a | 0d 0a 20 20 20 2f 2f 20 |.. }..|.. // |
|00003360| 50 61 69 6e 74 20 74 68 | 65 20 63 6f 6c 6f 72 73 |Paint th|e colors|
|00003370| 20 61 6e 64 20 74 65 78 | 74 2e 2e 2e 0d 0a 20 20 | and tex|t..... |
|00003380| 20 70 75 62 6c 69 63 20 | 73 79 6e 63 68 72 6f 6e | public |synchron|
|00003390| 69 7a 65 64 20 76 6f 69 | 64 20 70 61 69 6e 74 28 |ized voi|d paint(|
|000033a0| 47 72 61 70 68 69 63 73 | 20 67 29 20 7b 0d 0a 20 |Graphics| g) {.. |
|000033b0| 20 20 20 20 20 69 66 20 | 28 28 66 6f 72 65 67 72 | if |((foregr|
|000033c0| 6f 75 6e 64 20 3d 3d 20 | 6e 75 6c 6c 29 20 7c 7c |ound == |null) |||
|000033d0| 20 28 62 61 63 6b 67 72 | 6f 75 6e 64 20 3d 3d 20 | (backgr|ound == |
|000033e0| 6e 75 6c 6c 29 29 0d 0a | 20 20 20 20 20 20 20 20 |null))..| |
|000033f0| 20 72 65 74 75 72 6e 3b | 0d 0a 20 20 20 20 20 20 | return;|.. |
|00003400| 2f 2f 20 53 65 74 20 62 | 61 63 6b 67 72 6f 75 6e |// Set b|ackgroun|
|00003410| 64 2e 2e 2e 0d 0a 09 09 | 44 69 6d 65 6e 73 69 6f |d.......|Dimensio|
|00003420| 6e 20 64 6d 20 3d 20 73 | 69 7a 65 28 29 3b 0d 0a |n dm = s|ize();..|
|00003430| 09 09 67 2e 73 65 74 43 | 6f 6c 6f 72 28 62 61 63 |..g.setC|olor(bac|
|00003440| 6b 67 72 6f 75 6e 64 29 | 3b 0d 0a 09 09 67 2e 66 |kground)|;....g.f|
|00003450| 69 6c 6c 52 65 63 74 28 | 30 2c 30 2c 64 6d 2e 77 |illRect(|0,0,dm.w|
|00003460| 69 64 74 68 2c 64 6d 2e | 68 65 69 67 68 74 29 3b |idth,dm.|height);|
|00003470| 0d 0a 09 09 2f 2f 20 44 | 72 61 77 20 74 68 65 20 |....// D|raw the |
|00003480| 73 74 72 69 6e 67 0d 0a | 09 09 67 2e 73 65 74 43 |string..|..g.setC|
|00003490| 6f 6c 6f 72 28 66 6f 72 | 65 67 72 6f 75 6e 64 29 |olor(for|eground)|
|000034a0| 3b 0d 0a 20 20 20 20 20 | 20 2f 2f 20 53 65 74 20 |;.. | // Set |
|000034b0| 64 69 6d 65 6e 73 69 6f | 6e 73 2e 20 4d 6f 76 65 |dimensio|ns. Move|
|000034c0| 20 6a 75 73 74 20 66 72 | 6f 6d 20 6c 65 66 74 2e | just fr|om left.|
|000034d0| 2e 2e 0d 0a 20 20 20 20 | 20 20 46 6f 6e 74 4d 65 |.... | FontMe|
|000034e0| 74 72 69 63 73 20 66 6d | 20 3d 20 67 65 74 46 6f |trics fm| = getFo|
|000034f0| 6e 74 4d 65 74 72 69 63 | 73 28 67 65 74 46 6f 6e |ntMetric|s(getFon|
|00003500| 74 28 29 29 3b 0d 0a 20 | 20 20 20 20 20 69 6e 74 |t());.. | int|
|00003510| 20 78 20 3d 20 66 6d 2e | 63 68 61 72 57 69 64 74 | x = fm.|charWidt|
|00003520| 68 28 27 57 27 29 3b 0d | 0a 20 20 20 20 20 20 2f |h('W');.|. /|
|00003530| 2f 20 41 6e 64 20 63 65 | 6e 74 65 72 20 69 6e 20 |/ And ce|nter in |
|00003540| 68 65 69 67 68 74 2e 2e | 2e 0d 0a 20 20 20 20 20 |height..|... |
|00003550| 20 69 6e 74 20 79 20 3d | 20 66 6d 2e 67 65 74 48 | int y =| fm.getH|
|00003560| 65 69 67 68 74 28 29 3b | 0d 0a 09 09 67 2e 64 72 |eight();|....g.dr|
|00003570| 61 77 53 74 72 69 6e 67 | 28 64 69 73 70 6c 61 79 |awString|(display|
|00003580| 54 65 78 74 2c 78 2c 79 | 29 3b 0d 0a 20 20 20 7d |Text,x,y|);.. }|
|00003590| 0d 0a 7d 0d 0a 0d 0a 0d | 0a 2f 2f 20 43 6c 61 73 |..}.....|.// Clas|
|000035a0| 73 20 74 68 61 74 20 63 | 72 65 61 74 65 73 20 61 |s that c|reates a|
|000035b0| 20 73 65 72 69 65 73 20 | 6f 66 20 72 61 64 69 6f | series |of radio|
|000035c0| 20 62 75 74 74 6f 6e 73 | 0d 0a 2f 2f 20 66 6f 72 | buttons|..// for|
|000035d0| 20 43 6f 6c 6f 72 73 20 | 74 6f 20 63 68 6f 6f 73 | Colors |to choos|
|000035e0| 65 2e 2e 2e 2e 0d 0a 63 | 6c 61 73 73 20 43 6f 6c |e......c|lass Col|
|000035f0| 6f 72 65 64 43 68 65 63 | 6b 62 6f 78 47 72 6f 75 |oredChec|kboxGrou|
|00003600| 70 20 65 78 74 65 6e 64 | 73 20 43 68 65 63 6b 62 |p extend|s Checkb|
|00003610| 6f 78 47 72 6f 75 70 20 | 7b 0d 0a 20 20 20 2f 2f |oxGroup |{.. //|
|00003620| 20 41 72 72 61 79 20 74 | 6f 20 68 6f 6c 64 20 63 | Array t|o hold c|
|00003630| 68 65 63 6b 62 6f 78 65 | 73 2e 2e 2e 0d 0a 20 20 |heckboxe|s..... |
|00003640| 20 43 6f 6c 6f 72 65 64 | 43 68 65 63 6b 62 6f 78 | Colored|Checkbox|
|00003650| 20 63 5b 5d 20 3d 20 6e | 65 77 20 43 6f 6c 6f 72 | c[] = n|ew Color|
|00003660| 65 64 43 68 65 63 6b 62 | 6f 78 5b 31 32 5d 3b 0d |edCheckb|ox[12];.|
|00003670| 0a 20 20 20 2f 2f 20 43 | 6f 6e 73 74 72 75 63 74 |. // C|onstruct|
|00003680| 6f 72 2e 20 43 72 65 61 | 74 65 20 74 68 65 20 63 |or. Crea|te the c|
|00003690| 68 65 63 6b 62 6f 78 65 | 73 20 77 69 74 68 0d 0a |heckboxe|s with..|
|000036a0| 20 20 20 2f 2f 20 6e 6f | 20 64 65 66 61 75 6c 74 | // no| default|
|000036b0| 20 63 6f 6c 6f 72 20 63 | 68 6f 73 65 6e 2e 2e 2e | color c|hosen...|
|000036c0| 0d 0a 20 20 20 70 75 62 | 6c 69 63 20 43 6f 6c 6f |.. pub|lic Colo|
|000036d0| 72 65 64 43 68 65 63 6b | 62 6f 78 47 72 6f 75 70 |redCheck|boxGroup|
|000036e0| 28 50 61 6e 65 6c 20 70 | 2c 49 74 65 6d 4c 69 73 |(Panel p|,ItemLis|
|000036f0| 74 65 6e 65 72 20 6c 69 | 73 74 65 6e 65 72 29 20 |tener li|stener) |
|00003700| 7b 0d 0a 20 20 20 20 20 | 20 2f 2f 20 43 61 6c 6c |{.. | // Call|
|00003710| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 63 6f 6e | the def|ault con|
|00003720| 73 74 72 75 63 74 6f 72 | 2e 2e 2e 0d 0a 20 20 20 |structor|..... |
|00003730| 20 20 20 73 75 70 65 72 | 28 29 3b 0d 0a 20 20 20 | super|();.. |
|00003740| 20 20 20 2f 2f 20 43 72 | 65 61 74 65 20 74 68 65 | // Cr|eate the|
|00003750| 20 63 68 65 63 6b 62 6f | 78 65 73 20 61 6e 64 20 | checkbo|xes and |
|00003760| 73 74 6f 72 65 20 72 65 | 66 65 72 65 6e 63 65 73 |store re|ferences|
|00003770| 2e 2e 2e 0d 0a 20 20 20 | 20 20 20 63 5b 30 5d 20 |..... | c[0] |
|00003780| 3d 20 6e 65 77 20 43 6f | 6c 6f 72 65 64 43 68 65 |= new Co|loredChe|
|00003790| 63 6b 62 6f 78 28 43 6f | 6c 6f 72 2e 62 6c 61 63 |ckbox(Co|lor.blac|
|000037a0| 6b 2c 22 42 6c 61 63 6b | 22 2c 74 68 69 73 2c 66 |k,"Black|",this,f|
|000037b0| 61 6c 73 65 29 3b 0d 0a | 20 20 20 20 20 20 63 5b |alse);..| c[|
|000037c0| 30 5d 2e 61 64 64 49 74 | 65 6d 4c 69 73 74 65 6e |0].addIt|emListen|
|000037d0| 65 72 28 6c 69 73 74 65 | 6e 65 72 29 3b 0d 0a 20 |er(liste|ner);.. |
|000037e0| 20 20 20 20 20 70 2e 61 | 64 64 28 63 5b 30 5d 29 | p.a|dd(c[0])|
|000037f0| 3b 0d 0a 20 20 20 20 20 | 20 63 5b 31 5d 20 3d 20 |;.. | c[1] = |
|00003800| 6e 65 77 20 43 6f 6c 6f | 72 65 64 43 68 65 63 6b |new Colo|redCheck|
|00003810| 62 6f 78 28 43 6f 6c 6f | 72 2e 63 79 61 6e 2c 22 |box(Colo|r.cyan,"|
|00003820| 43 79 61 6e 22 2c 74 68 | 69 73 2c 66 61 6c 73 65 |Cyan",th|is,false|
|00003830| 29 3b 0d 0a 20 20 20 20 | 20 20 63 5b 31 5d 2e 61 |);.. | c[1].a|
|00003840| 64 64 49 74 65 6d 4c 69 | 73 74 65 6e 65 72 28 6c |ddItemLi|stener(l|
|00003850| 69 73 74 65 6e 65 72 29 | 3b 0d 0a 20 20 20 20 20 |istener)|;.. |
|00003860| 20 70 2e 61 64 64 28 63 | 5b 31 5d 29 3b 0d 0a 20 | p.add(c|[1]);.. |
|00003870| 20 20 20 20 20 63 5b 32 | 5d 20 3d 20 6e 65 77 20 | c[2|] = new |
|00003880| 43 6f 6c 6f 72 65 64 43 | 68 65 63 6b 62 6f 78 28 |ColoredC|heckbox(|
|00003890| 43 6f 6c 6f 72 2e 62 6c | 75 65 2c 22 42 6c 75 65 |Color.bl|ue,"Blue|
|000038a0| 22 2c 74 68 69 73 2c 66 | 61 6c 73 65 29 3b 0d 0a |",this,f|alse);..|
|000038b0| 20 20 20 20 20 20 63 5b | 32 5d 2e 61 64 64 49 74 | c[|2].addIt|
|000038c0| 65 6d 4c 69 73 74 65 6e | 65 72 28 6c 69 73 74 65 |emListen|er(liste|
|000038d0| 6e 65 72 29 3b 0d 0a 20 | 20 20 20 20 20 70 2e 61 |ner);.. | p.a|
|000038e0| 64 64 28 63 5b 32 5d 29 | 3b 0d 0a 20 20 20 20 20 |dd(c[2])|;.. |
|000038f0| 20 63 5b 33 5d 20 3d 20 | 6e 65 77 20 43 6f 6c 6f | c[3] = |new Colo|
|00003900| 72 65 64 43 68 65 63 6b | 62 6f 78 28 43 6f 6c 6f |redCheck|box(Colo|
|00003910| 72 2e 64 61 72 6b 47 72 | 61 79 2c 22 44 61 72 6b |r.darkGr|ay,"Dark|
|00003920| 20 47 72 61 79 22 2c 74 | 68 69 73 2c 66 61 6c 73 | Gray",t|his,fals|
|00003930| 65 29 3b 0d 0a 20 20 20 | 20 20 20 63 5b 33 5d 2e |e);.. | c[3].|
|00003940| 61 64 64 49 74 65 6d 4c | 69 73 74 65 6e 65 72 28 |addItemL|istener(|
|00003950| 6c 69 73 74 65 6e 65 72 | 29 3b 0d 0a 20 20 20 20 |listener|);.. |
|00003960| 20 20 70 2e 61 64 64 28 | 63 5b 33 5d 29 3b 0d 0a | p.add(|c[3]);..|
|00003970| 20 20 20 20 20 20 63 5b | 34 5d 20 3d 20 6e 65 77 | c[|4] = new|
|00003980| 20 43 6f 6c 6f 72 65 64 | 43 68 65 63 6b 62 6f 78 | Colored|Checkbox|
|00003990| 28 43 6f 6c 6f 72 2e 70 | 69 6e 6b 2c 22 50 69 6e |(Color.p|ink,"Pin|
|000039a0| 6b 22 2c 74 68 69 73 2c | 66 61 6c 73 65 29 3b 0d |k",this,|false);.|
|000039b0| 0a 20 20 20 20 20 20 63 | 5b 34 5d 2e 61 64 64 49 |. c|[4].addI|
|000039c0| 74 65 6d 4c 69 73 74 65 | 6e 65 72 28 6c 69 73 74 |temListe|ner(list|
|000039d0| 65 6e 65 72 29 3b 0d 0a | 20 20 20 20 20 20 70 2e |ener);..| p.|
|000039e0| 61 64 64 28 63 5b 34 5d | 29 3b 0d 0a 20 20 20 20 |add(c[4]|);.. |
|000039f0| 20 20 63 5b 35 5d 20 3d | 20 6e 65 77 20 43 6f 6c | c[5] =| new Col|
|00003a00| 6f 72 65 64 43 68 65 63 | 6b 62 6f 78 28 43 6f 6c |oredChec|kbox(Col|
|00003a10| 6f 72 2e 67 72 65 65 6e | 2c 22 47 72 65 65 6e 22 |or.green|,"Green"|
|00003a20| 2c 74 68 69 73 2c 66 61 | 6c 73 65 29 3b 0d 0a 20 |,this,fa|lse);.. |
|00003a30| 20 20 20 20 20 63 5b 35 | 5d 2e 61 64 64 49 74 65 | c[5|].addIte|
|00003a40| 6d 4c 69 73 74 65 6e 65 | 72 28 6c 69 73 74 65 6e |mListene|r(listen|
|00003a50| 65 72 29 3b 0d 0a 20 20 | 20 20 20 20 70 2e 61 64 |er);.. | p.ad|
|00003a60| 64 28 63 5b 35 5d 29 3b | 0d 0a 20 20 20 20 20 20 |d(c[5]);|.. |
|00003a70| 63 5b 36 5d 20 3d 20 6e | 65 77 20 43 6f 6c 6f 72 |c[6] = n|ew Color|
|00003a80| 65 64 43 68 65 63 6b 62 | 6f 78 28 43 6f 6c 6f 72 |edCheckb|ox(Color|
|00003a90| 2e 6c 69 67 68 74 47 72 | 61 79 2c 22 4c 69 67 68 |.lightGr|ay,"Ligh|
|00003aa0| 74 20 47 72 61 79 22 2c | 74 68 69 73 2c 66 61 6c |t Gray",|this,fal|
|00003ab0| 73 65 29 3b 0d 0a 20 20 | 20 20 20 20 63 5b 36 5d |se);.. | c[6]|
|00003ac0| 2e 61 64 64 49 74 65 6d | 4c 69 73 74 65 6e 65 72 |.addItem|Listener|
|00003ad0| 28 6c 69 73 74 65 6e 65 | 72 29 3b 0d 0a 20 20 20 |(listene|r);.. |
|00003ae0| 20 20 20 70 2e 61 64 64 | 28 63 5b 36 5d 29 3b 0d | p.add|(c[6]);.|
|00003af0| 0a 20 20 20 20 20 20 63 | 5b 37 5d 20 3d 20 6e 65 |. c|[7] = ne|
|00003b00| 77 20 43 6f 6c 6f 72 65 | 64 43 68 65 63 6b 62 6f |w Colore|dCheckbo|
|00003b10| 78 28 43 6f 6c 6f 72 2e | 6d 61 67 65 6e 74 61 2c |x(Color.|magenta,|
|00003b20| 22 4d 61 67 65 6e 74 61 | 22 2c 74 68 69 73 2c 66 |"Magenta|",this,f|
|00003b30| 61 6c 73 65 29 3b 0d 0a | 20 20 20 20 20 20 63 5b |alse);..| c[|
|00003b40| 37 5d 2e 61 64 64 49 74 | 65 6d 4c 69 73 74 65 6e |7].addIt|emListen|
|00003b50| 65 72 28 6c 69 73 74 65 | 6e 65 72 29 3b 0d 0a 20 |er(liste|ner);.. |
|00003b60| 20 20 20 20 20 70 2e 61 | 64 64 28 63 5b 37 5d 29 | p.a|dd(c[7])|
|00003b70| 3b 0d 0a 20 20 20 20 20 | 20 63 5b 38 5d 20 3d 20 |;.. | c[8] = |
|00003b80| 6e 65 77 20 43 6f 6c 6f | 72 65 64 43 68 65 63 6b |new Colo|redCheck|
|00003b90| 62 6f 78 28 43 6f 6c 6f | 72 2e 72 65 64 2c 22 52 |box(Colo|r.red,"R|
|00003ba0| 65 64 22 2c 74 68 69 73 | 2c 66 61 6c 73 65 29 3b |ed",this|,false);|
|00003bb0| 0d 0a 20 20 20 20 20 20 | 63 5b 38 5d 2e 61 64 64 |.. |c[8].add|
|00003bc0| 49 74 65 6d 4c 69 73 74 | 65 6e 65 72 28 6c 69 73 |ItemList|ener(lis|
|00003bd0| 74 65 6e 65 72 29 3b 0d | 0a 20 20 20 20 20 20 70 |tener);.|. p|
|00003be0| 2e 61 64 64 28 63 5b 38 | 5d 29 3b 0d 0a 20 20 20 |.add(c[8|]);.. |
|00003bf0| 20 20 20 63 5b 39 5d 20 | 3d 20 6e 65 77 20 43 6f | c[9] |= new Co|
|00003c00| 6c 6f 72 65 64 43 68 65 | 63 6b 62 6f 78 28 43 6f |loredChe|ckbox(Co|
|00003c10| 6c 6f 72 2e 77 68 69 74 | 65 2c 22 57 68 69 74 65 |lor.whit|e,"White|
|00003c20| 22 2c 74 68 69 73 2c 66 | 61 6c 73 65 29 3b 0d 0a |",this,f|alse);..|
|00003c30| 20 20 20 20 20 20 63 5b | 39 5d 2e 61 64 64 49 74 | c[|9].addIt|
|00003c40| 65 6d 4c 69 73 74 65 6e | 65 72 28 6c 69 73 74 65 |emListen|er(liste|
|00003c50| 6e 65 72 29 3b 0d 0a 20 | 20 20 20 20 20 70 2e 61 |ner);.. | p.a|
|00003c60| 64 64 28 63 5b 39 5d 29 | 3b 0d 0a 20 20 20 20 20 |dd(c[9])|;.. |
|00003c70| 20 63 5b 31 30 5d 20 3d | 20 6e 65 77 20 43 6f 6c | c[10] =| new Col|
|00003c80| 6f 72 65 64 43 68 65 63 | 6b 62 6f 78 28 43 6f 6c |oredChec|kbox(Col|
|00003c90| 6f 72 2e 6f 72 61 6e 67 | 65 2c 22 4f 72 61 6e 67 |or.orang|e,"Orang|
|00003ca0| 65 22 2c 74 68 69 73 2c | 66 61 6c 73 65 29 3b 0d |e",this,|false);.|
|00003cb0| 0a 20 20 20 20 20 20 63 | 5b 31 30 5d 2e 61 64 64 |. c|[10].add|
|00003cc0| 49 74 65 6d 4c 69 73 74 | 65 6e 65 72 28 6c 69 73 |ItemList|ener(lis|
|00003cd0| 74 65 6e 65 72 29 3b 0d | 0a 20 20 20 20 20 20 70 |tener);.|. p|
|00003ce0| 2e 61 64 64 28 63 5b 31 | 30 5d 29 3b 20 0d 0a 20 |.add(c[1|0]); .. |
|00003cf0| 20 20 20 20 20 63 5b 31 | 31 5d 20 3d 20 6e 65 77 | c[1|1] = new|
|00003d00| 20 43 6f 6c 6f 72 65 64 | 43 68 65 63 6b 62 6f 78 | Colored|Checkbox|
|00003d10| 28 43 6f 6c 6f 72 2e 79 | 65 6c 6c 6f 77 2c 22 59 |(Color.y|ellow,"Y|
|00003d20| 65 6c 6c 6f 77 22 2c 74 | 68 69 73 2c 66 61 6c 73 |ellow",t|his,fals|
|00003d30| 65 29 3b 0d 0a 20 20 20 | 20 20 20 63 5b 31 31 5d |e);.. | c[11]|
|00003d40| 2e 61 64 64 49 74 65 6d | 4c 69 73 74 65 6e 65 72 |.addItem|Listener|
|00003d50| 28 6c 69 73 74 65 6e 65 | 72 29 3b 0d 0a 20 20 20 |(listene|r);.. |
|00003d60| 20 20 20 70 2e 61 64 64 | 28 63 5b 31 31 5d 29 3b | p.add|(c[11]);|
|00003d70| 0d 0a 20 20 20 7d 0d 0a | 0d 0a 20 20 20 2f 2f 20 |.. }..|.. // |
|00003d80| 53 65 74 20 74 68 65 20 | 72 61 64 69 6f 20 62 75 |Set the |radio bu|
|00003d90| 74 74 6f 6e 20 6f 66 20 | 74 68 65 20 63 68 65 63 |tton of |the chec|
|00003da0| 6b 62 6f 78 20 74 68 61 | 74 0d 0a 20 20 20 2f 2f |kbox tha|t.. //|
|00003db0| 20 6d 61 74 63 68 65 73 | 20 74 68 65 20 63 6f 6c | matches| the col|
|00003dc0| 6f 72 0d 0a 20 20 20 70 | 75 62 6c 69 63 20 76 6f |or.. p|ublic vo|
|00003dd0| 69 64 20 73 65 74 4d 61 | 74 63 68 69 6e 67 43 6f |id setMa|tchingCo|
|00003de0| 6c 6f 72 28 43 6f 6c 6f | 72 20 6d 61 74 63 68 29 |lor(Colo|r match)|
|00003df0| 20 7b 0d 0a 20 20 20 20 | 20 20 66 6f 72 20 28 69 | {.. | for (i|
|00003e00| 6e 74 20 69 20 3d 20 30 | 3b 20 69 20 3c 20 63 2e |nt i = 0|; i < c.|
|00003e10| 6c 65 6e 67 74 68 3b 20 | 2b 2b 69 29 0d 0a 20 20 |length; |++i).. |
|00003e20| 20 20 20 20 20 20 20 63 | 5b 69 5d 2e 73 65 74 49 | c|[i].setI|
|00003e30| 66 43 6f 6c 6f 72 4d 61 | 74 63 68 65 73 28 6d 61 |fColorMa|tches(ma|
|00003e40| 74 63 68 29 3b 0d 0a 20 | 20 20 7d 0d 0a 7d 0d 0a |tch);.. | }..}..|
|00003e50| 0d 0a 0d 0a 2f 2f 20 43 | 6c 61 73 73 20 66 6f 72 |....// C|lass for|
|00003e60| 20 63 72 65 61 74 69 6e | 67 20 61 20 63 68 65 63 | creatin|g a chec|
|00003e70| 6b 62 6f 78 20 61 73 73 | 6f 63 69 61 74 65 64 0d |kbox ass|ociated.|
|00003e80| 0a 2f 2f 20 77 69 74 68 | 20 61 20 67 69 76 65 6e |.// with| a given|
|00003e90| 20 63 6f 6c 6f 72 2e 2e | 2e 0d 0a 63 6c 61 73 73 | color..|...class|
|00003ea0| 20 43 6f 6c 6f 72 65 64 | 43 68 65 63 6b 62 6f 78 | Colored|Checkbox|
|00003eb0| 20 65 78 74 65 6e 64 73 | 20 43 68 65 63 6b 62 6f | extends| Checkbo|
|00003ec0| 78 20 7b 0d 0a 20 20 20 | 43 6f 6c 6f 72 20 63 6f |x {.. |Color co|
|00003ed0| 6c 6f 72 3b 20 20 2f 2f | 20 54 68 65 20 63 6f 6c |lor; //| The col|
|00003ee0| 6f 72 20 6f 66 20 74 68 | 69 73 20 63 68 65 63 6b |or of th|is check|
|00003ef0| 62 6f 78 2e 2e 2e 0d 0a | 20 20 20 2f 2f 20 43 6f |box.....| // Co|
|00003f00| 6e 73 74 72 75 63 74 6f | 72 20 63 72 65 61 74 65 |nstructo|r create|
|00003f10| 73 20 63 68 65 63 6b 62 | 6f 78 20 77 69 74 68 20 |s checkb|ox with |
|00003f20| 73 70 65 63 69 66 69 65 | 64 20 63 6f 6c 6f 72 2e |specifie|d color.|
|00003f30| 2e 2e 0d 0a 20 20 20 70 | 75 62 6c 69 63 20 43 6f |.... p|ublic Co|
|00003f40| 6c 6f 72 65 64 43 68 65 | 63 6b 62 6f 78 28 43 6f |loredChe|ckbox(Co|
|00003f50| 6c 6f 72 20 63 6f 6c 6f | 72 2c 20 53 74 72 69 6e |lor colo|r, Strin|
|00003f60| 67 20 6c 61 62 65 6c 2c | 0d 0a 20 20 20 20 20 20 |g label,|.. |
|00003f70| 20 20 20 43 68 65 63 6b | 62 6f 78 47 72 6f 75 70 | Check|boxGroup|
|00003f80| 20 67 72 70 2c 20 62 6f | 6f 6c 65 61 6e 20 73 65 | grp, bo|olean se|
|00003f90| 74 29 20 7b 0d 0a 20 20 | 20 20 20 20 20 20 20 2f |t) {.. | /|
|00003fa0| 2f 20 43 61 6c 6c 20 74 | 68 65 20 64 65 66 61 75 |/ Call t|he defau|
|00003fb0| 6c 74 20 63 6f 6e 73 74 | 72 75 63 74 6f 72 2e 2e |lt const|ructor..|
|00003fc0| 2e 0d 0a 20 20 20 20 20 | 20 20 20 20 73 75 70 65 |... | supe|
|00003fd0| 72 28 6c 61 62 65 6c 2c | 67 72 70 2c 73 65 74 29 |r(label,|grp,set)|
|00003fe0| 3b 0d 0a 20 20 20 20 20 | 20 20 20 20 74 68 69 73 |;.. | this|
|00003ff0| 2e 63 6f 6c 6f 72 20 3d | 20 63 6f 6c 6f 72 3b 0d |.color =| color;.|
|00004000| 0a 20 20 20 20 20 20 20 | 20 20 73 65 74 42 61 63 |. | setBac|
|00004010| 6b 67 72 6f 75 6e 64 28 | 63 6f 6c 6f 72 29 3b 0d |kground(|color);.|
|00004020| 0a 20 20 20 7d 0d 0a 20 | 20 20 2f 2f 20 53 65 74 |. }.. | // Set|
|00004030| 73 20 69 74 73 65 6c 66 | 20 74 6f 20 74 72 75 65 |s itself| to true|
|00004040| 20 69 66 20 69 74 20 6d | 61 74 63 68 65 73 20 74 | if it m|atches t|
|00004050| 68 65 20 63 6f 6c 6f 72 | 0d 0a 20 20 20 70 75 62 |he color|.. pub|
|00004060| 6c 69 63 20 76 6f 69 64 | 20 73 65 74 49 66 43 6f |lic void| setIfCo|
|00004070| 6c 6f 72 4d 61 74 63 68 | 65 73 28 43 6f 6c 6f 72 |lorMatch|es(Color|
|00004080| 20 6d 61 74 63 68 29 20 | 7b 0d 0a 20 20 20 20 20 | match) |{.. |
|00004090| 20 69 66 20 28 63 6f 6c | 6f 72 20 3d 3d 20 6d 61 | if (col|or == ma|
|000040a0| 74 63 68 29 0d 0a 20 20 | 20 20 20 20 20 20 20 73 |tch).. | s|
|000040b0| 65 74 53 74 61 74 65 28 | 74 72 75 65 29 3b 0d 0a |etState(|true);..|
|000040c0| 20 20 20 20 20 20 65 6c | 73 65 0d 0a 20 20 20 20 | el|se.. |
|000040d0| 20 20 20 20 20 73 65 74 | 53 74 61 74 65 28 66 61 | set|State(fa|
|000040e0| 6c 73 65 29 3b 0d 0a 20 | 20 20 7d 0d 0a 20 20 20 |lse);.. | }.. |
|000040f0| 2f 2f 20 52 65 74 75 72 | 6e 20 74 68 65 20 63 6f |// Retur|n the co|
|00004100| 6c 6f 72 20 6d 61 74 63 | 68 69 6e 67 20 74 68 69 |lor matc|hing thi|
|00004110| 73 20 62 6f 78 2e 2e 2e | 0d 0a 20 20 20 70 75 62 |s box...|.. pub|
|00004120| 6c 69 63 20 43 6f 6c 6f | 72 20 67 65 74 43 6f 6c |lic Colo|r getCol|
|00004130| 6f 72 28 29 20 7b 0d 0a | 20 20 20 20 20 20 72 65 |or() {..| re|
|00004140| 74 75 72 6e 20 63 6f 6c | 6f 72 3b 0d 0a 20 20 20 |turn col|or;.. |
|00004150| 7d 0d 0a 7d 0d 0a 0d 0a | 0d 0a 0d 0a 0d 0a 00 00 |}..}....|........|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004200| 43 68 61 70 32 33 2f 43 | 68 6f 6f 73 65 46 6f 6e |Chap23/C|hooseFon|
|00004210| 74 2f 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |t/......|........|
|00004220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004260| 00 00 00 00 20 34 30 37 | 37 37 20 00 20 20 20 20 |.... 407|77 . |
|00004270| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00004280| 20 20 20 20 20 20 30 20 | 20 36 33 33 32 37 33 30 | 0 | 6332730|
|00004290| 33 32 32 20 20 31 33 30 | 37 34 00 20 35 00 00 00 |322 130|74. 5...|
|000042a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000042f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004300| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00004310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004320| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00004330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004340| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00004350| 20 20 20 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 0 ...|........|
|00004360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000043f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004400| 43 68 61 70 32 33 2f 43 | 68 6f 6f 73 65 46 6f 6e |Chap23/C|hooseFon|
|00004410| 74 2f 65 78 61 6d 70 6c | 65 31 2e 68 74 6d 6c 00 |t/exampl|e1.html.|
|00004420| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004430| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004460| 00 00 00 00 31 30 30 36 | 36 36 20 00 20 20 20 20 |....1006|66 . |
|00004470| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00004480| 20 20 20 20 31 37 32 20 | 20 36 32 37 37 30 36 33 | 172 | 6277063|
|00004490| 35 35 30 20 20 31 35 36 | 32 37 00 20 30 00 00 00 |550 156|27. 0...|
|000044a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000044f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004500| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00004510| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004520| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00004530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004540| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00004550| 20 32 30 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 200 ...|........|
|00004560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004580| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004590| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000045f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004600| 3c 74 69 74 6c 65 3e 43 | 68 6f 6f 73 65 20 46 6f |<title>C|hoose Fo|
|00004610| 6e 74 20 44 69 61 6c 6f | 67 20 41 70 70 6c 65 74 |nt Dialo|g Applet|
|00004620| 20 41 3c 2f 74 69 74 6c | 65 3e 0d 0a 3c 68 72 3e | A</titl|e>..<hr>|
|00004630| 0d 0a 3c 61 70 70 6c 65 | 74 20 63 6f 64 65 3d 22 |..<apple|t code="|
|00004640| 43 68 6f 6f 73 65 46 6f | 6e 74 44 69 61 6c 6f 67 |ChooseFo|ntDialog|
|00004650| 41 70 70 6c 65 74 22 20 | 77 69 64 74 68 3d 31 30 |Applet" |width=10|
|00004660| 30 20 68 65 69 67 68 74 | 3d 31 30 30 3e 0d 0a 3c |0 height|=100>..<|
|00004670| 2f 61 70 70 6c 65 74 3e | 0d 0a 00 00 00 00 00 00 |/applet>|........|
|00004680| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004690| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000046f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004710| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004720| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004730| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004780| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004790| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000047f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004800| 43 68 61 70 32 33 2f 43 | 68 6f 6f 73 65 46 6f 6e |Chap23/C|hooseFon|
|00004810| 74 2f 43 68 6f 6f 73 65 | 46 6f 6e 74 44 69 61 6c |t/Choose|FontDial|
|00004820| 6f 67 41 70 70 6c 65 74 | 2e 6a 61 76 61 00 00 00 |ogApplet|.java...|
|00004830| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004840| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004850| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004860| 00 00 00 00 31 30 30 36 | 36 36 20 00 20 20 20 20 |....1006|66 . |
|00004870| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00004880| 20 20 32 32 37 36 31 20 | 20 36 32 37 37 30 37 32 | 22761 | 6277072|
|00004890| 34 31 36 20 20 32 30 34 | 37 36 00 20 30 00 00 00 |416 204|76. 0...|
|000048a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000048f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004900| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00004910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004920| 00 00 00 00 00 00 00 00 | 00 77 68 65 65 6c 00 00 |........|.wheel..|
|00004930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004940| 00 00 00 00 00 00 00 00 | 00 20 20 20 20 20 20 20 |........|. |
|00004950| 20 32 30 30 20 00 00 00 | 00 00 00 00 00 00 00 00 | 200 ...|........|
|00004960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000049f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004a00| 0d 0a 2f 2a 20 43 68 6f | 6f 73 65 46 6f 6e 74 44 |../* Cho|oseFontD|
|00004a10| 69 61 6c 6f 67 41 70 70 | 6c 65 74 2e 6a 61 76 61 |ialogApp|let.java|
|00004a20| 09 09 09 41 75 74 68 6f | 72 20 43 61 73 65 79 20 |...Autho|r Casey |
|00004a30| 48 6f 70 73 6f 6e 0d 0a | 2a 20 20 09 09 09 09 09 |Hopson..|* .....|
|00004a40| 09 09 20 20 20 47 65 69 | 73 74 20 53 6f 66 74 77 |.. Gei|st Softw|
|00004a50| 61 72 65 20 61 6e 64 20 | 53 65 72 76 69 63 65 73 |are and |Services|
|00004a60| 2c 20 49 6e 63 2e 20 0d | 0a 2a 0d 0a 2a 09 50 65 |, Inc. .|.*..*.Pe|
|00004a70| 72 6d 69 73 73 69 6f 6e | 20 74 6f 20 75 73 65 2c |rmission| to use,|
|00004a80| 20 63 6f 70 79 2c 20 6d | 6f 64 69 66 79 2c 20 61 | copy, m|odify, a|
|00004a90| 6e 64 20 64 69 73 74 72 | 69 62 75 74 65 0d 0a 2a |nd distr|ibute..*|
|00004aa0| 09 74 68 69 73 20 73 6f | 66 74 77 61 72 65 20 66 |.this so|ftware f|
|00004ab0| 6f 72 20 4e 4f 4e 5f 43 | 4f 4d 4d 45 52 43 49 41 |or NON_C|OMMERCIA|
|00004ac0| 4c 20 70 75 72 70 6f 73 | 65 73 20 61 6e 64 20 77 |L purpos|es and w|
|00004ad0| 69 74 68 6f 75 74 0d 0a | 2a 20 20 66 65 65 20 69 |ithout..|* fee i|
|00004ae0| 73 20 68 65 72 65 62 79 | 20 67 72 61 6e 74 65 64 |s hereby| granted|
|00004af0| 20 70 72 6f 76 69 64 65 | 64 20 74 68 61 74 20 74 | provide|d that t|
|00004b00| 68 69 73 20 63 6f 70 79 | 72 69 67 68 74 20 6e 6f |his copy|right no|
|00004b10| 74 69 63 65 0d 0a 2a 20 | 20 61 70 70 65 61 72 73 |tice..* | appears|
|00004b20| 20 69 6e 20 61 6c 6c 20 | 63 6f 70 69 65 73 2e 0d | in all |copies..|
|00004b30| 0a 2a 0d 0a 2a 09 54 68 | 65 20 63 72 65 61 74 6f |.*..*.Th|e creato|
|00004b40| 72 73 20 6f 66 20 74 68 | 69 73 20 73 6f 66 74 77 |rs of th|is softw|
|00004b50| 61 72 65 20 6d 61 6b 65 | 20 6e 6f 20 72 65 70 72 |are make| no repr|
|00004b60| 65 73 65 6e 74 61 74 69 | 6f 6e 73 20 6f 72 0d 0a |esentati|ons or..|
|00004b70| 2a 09 77 61 72 72 61 6e | 74 69 65 73 20 61 62 6f |*.warran|ties abo|
|00004b80| 75 74 20 74 68 65 20 73 | 75 69 74 61 62 69 6c 69 |ut the s|uitabili|
|00004b90| 74 79 20 6f 66 20 74 68 | 65 20 73 6f 66 74 77 61 |ty of th|e softwa|
|00004ba0| 72 65 2c 20 65 69 74 68 | 65 72 0d 0a 2a 20 20 65 |re, eith|er..* e|
|00004bb0| 78 70 72 65 73 73 20 6f | 72 20 69 6d 70 6c 69 65 |xpress o|r implie|
|00004bc0| 64 2e 20 20 54 68 65 20 | 63 72 65 61 74 6f 72 73 |d. The |creators|
|00004bd0| 20 73 68 61 6c 6c 20 6e | 6f 74 20 62 65 20 6c 69 | shall n|ot be li|
|00004be0| 61 62 6c 65 20 66 6f 72 | 0d 0a 2a 20 20 61 6e 79 |able for|..* any|
|00004bf0| 20 64 61 6d 61 67 65 73 | 20 73 75 66 66 65 72 65 | damages| suffere|
|00004c00| 64 20 62 79 20 6c 69 63 | 65 6e 73 65 65 20 61 73 |d by lic|ensee as|
|00004c10| 20 61 20 72 65 73 75 6c | 74 20 6f 66 20 75 73 69 | a resul|t of usi|
|00004c20| 6e 67 2c 0d 0a 2a 20 20 | 6d 6f 64 69 66 79 69 6e |ng,..* |modifyin|
|00004c30| 67 20 6f 72 20 64 69 73 | 74 72 69 62 75 74 69 6e |g or dis|tributin|
|00004c40| 67 20 74 68 69 73 20 73 | 6f 66 74 77 61 72 65 20 |g this s|oftware |
|00004c50| 6f 72 20 69 74 73 20 64 | 65 72 69 76 61 74 69 76 |or its d|erivativ|
|00004c60| 65 73 2e 0d 0a 2a 2f 0d | 0a 0d 0a 0d 0a 0d 0a 69 |es...*/.|.......i|
|00004c70| 6d 70 6f 72 74 20 6a 61 | 76 61 2e 61 70 70 6c 65 |mport ja|va.apple|
|00004c80| 74 2e 2a 3b 0d 0a 69 6d | 70 6f 72 74 20 6a 61 76 |t.*;..im|port jav|
|00004c90| 61 2e 61 77 74 2e 2a 3b | 0d 0a 69 6d 70 6f 72 74 |a.awt.*;|..import|
|00004ca0| 20 6a 61 76 61 2e 61 77 | 74 2e 65 76 65 6e 74 2e | java.aw|t.event.|
|00004cb0| 2a 3b 0d 0a 69 6d 70 6f | 72 74 20 6a 61 76 61 2e |*;..impo|rt java.|
|00004cc0| 6c 61 6e 67 2e 2a 3b 0d | 0a 0d 0a 0d 0a 2f 2f 20 |lang.*;.|.....// |
|00004cd0| 44 69 61 6c 6f 67 20 62 | 6f 78 20 66 6f 72 20 63 |Dialog b|ox for c|
|00004ce0| 68 6f 6f 73 69 6e 67 20 | 64 69 73 70 6c 61 79 20 |hoosing |display |
|00004cf0| 63 6f 6c 6f 72 73 2e 2e | 2e 0d 0a 70 75 62 6c 69 |colors..|...publi|
|00004d00| 63 20 63 6c 61 73 73 20 | 43 68 6f 6f 73 65 46 6f |c class |ChooseFo|
|00004d10| 6e 74 44 69 61 6c 6f 67 | 41 70 70 6c 65 74 20 65 |ntDialog|Applet e|
|00004d20| 78 74 65 6e 64 73 20 41 | 70 70 6c 65 74 20 7b 0d |xtends A|pplet {.|
|00004d30| 0a 20 20 20 20 70 75 62 | 6c 69 63 20 76 6f 69 64 |. pub|lic void|
|00004d40| 20 69 6e 69 74 28 29 20 | 7b 0d 0a 20 20 20 20 20 | init() |{.. |
|00004d50| 20 2f 2f 20 43 72 65 61 | 74 65 20 74 68 65 20 66 | // Crea|te the f|
|00004d60| 72 61 6d 65 20 77 69 74 | 68 20 61 20 74 69 74 6c |rame wit|h a titl|
|00004d70| 65 2e 2e 2e 0d 0a 20 20 | 20 20 20 20 6e 65 77 20 |e..... | new |
|00004d80| 43 68 6f 6f 73 65 46 6f | 6e 74 44 69 61 6c 6f 67 |ChooseFo|ntDialog|
|00004d90| 46 72 61 6d 65 28 22 53 | 68 6f 77 20 46 6f 6e 74 |Frame("S|how Font|
|00004da0| 20 44 69 61 6c 6f 67 22 | 29 3b 20 0d 0a 20 20 20 | Dialog"|); .. |
|00004db0| 20 7d 0d 0a 7d 20 20 20 | 20 20 20 0d 0a 0d 0a 63 | }..} | ....c|
|00004dc0| 6c 61 73 73 20 43 68 6f | 6f 73 65 46 6f 6e 74 44 |lass Cho|oseFontD|
|00004dd0| 69 61 6c 6f 67 46 72 61 | 6d 65 20 65 78 74 65 6e |ialogFra|me exten|
|00004de0| 64 73 20 46 72 61 6d 65 | 20 7b 0d 0a 20 20 20 20 |ds Frame| {.. |
|00004df0| 70 75 62 6c 69 63 20 43 | 68 6f 6f 73 65 46 6f 6e |public C|hooseFon|
|00004e00| 74 44 69 61 6c 6f 67 46 | 72 61 6d 65 28 53 74 72 |tDialogF|rame(Str|
|00004e10| 69 6e 67 20 74 69 74 6c | 65 29 20 7b 0d 0a 20 20 |ing titl|e) {.. |
|00004e20| 20 20 20 20 20 2f 2f 20 | 43 61 6c 6c 20 74 68 65 | // |Call the|
|00004e30| 20 73 75 70 65 72 63 6c | 61 73 73 20 63 6f 6e 73 | supercl|ass cons|
|00004e40| 74 72 75 63 74 6f 72 2e | 2e 2e 0d 0a 20 20 20 20 |tructor.|.... |
|00004e50| 20 20 20 73 75 70 65 72 | 28 74 69 74 6c 65 29 3b | super|(title);|
|00004e60| 0d 0a 20 20 20 20 20 20 | 20 72 65 73 69 7a 65 28 |.. | resize(|
|00004e70| 31 30 2c 31 30 29 3b 0d | 0a 20 20 20 20 20 20 20 |10,10);.|. |
|00004e80| 73 68 6f 77 28 29 3b 0d | 0a 20 20 20 20 20 20 20 |show();.|. |
|00004e90| 2f 2f 20 43 72 65 61 74 | 65 20 61 6e 64 20 73 68 |// Creat|e and sh|
|00004ea0| 6f 77 20 74 68 65 20 64 | 69 61 6c 6f 67 0d 0a 20 |ow the d|ialog.. |
|00004eb0| 20 20 20 20 20 20 43 68 | 6f 6f 73 65 46 6f 6e 74 | Ch|ooseFont|
|00004ec0| 44 69 61 6c 6f 67 20 64 | 6c 67 20 3d 20 6e 65 77 |Dialog d|lg = new|
|00004ed0| 20 43 68 6f 6f 73 65 46 | 6f 6e 74 44 69 61 6c 6f | ChooseF|ontDialo|
|00004ee0| 67 28 74 68 69 73 2c 74 | 72 75 65 29 3b 0d 0a 20 |g(this,t|rue);.. |
|00004ef0| 20 20 20 20 20 20 64 6c | 67 2e 73 68 6f 77 28 29 | dl|g.show()|
|00004f00| 3b 0d 0a 20 20 20 20 7d | 0d 0a 7d 0d 0a 0d 0a 2f |;.. }|..}..../|
|00004f10| 2f 20 4c 69 73 74 65 6e | 65 72 73 20 66 6f 72 20 |/ Listen|ers for |
|00004f20| 74 68 65 20 43 6f 6c 6f | 72 20 44 69 61 6c 6f 67 |the Colo|r Dialog|
|00004f30| 0d 0a 2f 2f 20 54 68 69 | 73 20 6f 6e 65 20 69 73 |..// Thi|s one is|
|00004f40| 20 66 6f 72 20 74 68 65 | 20 61 6c 6c 20 74 68 65 | for the| all the|
|00004f50| 20 72 65 70 61 69 6e 74 | 20 72 6f 75 74 69 6e 65 | repaint| routine|
|00004f60| 73 2e 2e 2e 0d 0a 63 6c | 61 73 73 20 46 6f 6e 74 |s.....cl|ass Font|
|00004f70| 49 74 65 6d 4c 69 73 74 | 65 6e 65 72 20 69 6d 70 |ItemList|ener imp|
|00004f80| 6c 65 6d 65 6e 74 73 20 | 49 74 65 6d 4c 69 73 74 |lements |ItemList|
|00004f90| 65 6e 65 72 20 7b 0d 0a | 20 20 20 43 68 6f 6f 73 |ener {..| Choos|
|00004fa0| 65 46 6f 6e 74 44 69 61 | 6c 6f 67 20 64 6c 67 3b |eFontDia|log dlg;|
|00004fb0| 20 2f 2f 20 54 68 65 20 | 63 6f 6c 6f 72 20 64 69 | // The |color di|
|00004fc0| 61 6c 6f 67 2e 2e 2e 0d | 0a 20 20 20 2f 2f 20 43 |alog....|. // C|
|00004fd0| 6f 6e 73 74 72 75 63 74 | 6f 72 2e 2e 2e 0d 0a 20 |onstruct|or..... |
|00004fe0| 20 20 70 75 62 6c 69 63 | 20 46 6f 6e 74 49 74 65 | public| FontIte|
|00004ff0| 6d 4c 69 73 74 65 6e 65 | 72 28 43 68 6f 6f 73 65 |mListene|r(Choose|
|00005000| 46 6f 6e 74 44 69 61 6c | 6f 67 20 64 6c 67 29 20 |FontDial|og dlg) |
|00005010| 7b 0d 0a 20 20 20 20 20 | 20 20 20 74 68 69 73 2e |{.. | this.|
|00005020| 64 6c 67 20 3d 20 64 6c | 67 3b 0d 0a 20 20 20 7d |dlg = dl|g;.. }|
|00005030| 0d 0a 20 20 20 2f 2f 20 | 48 61 6e 64 6c 65 20 74 |.. // |Handle t|
|00005040| 68 65 20 61 63 74 69 6f | 6e 20 74 6f 20 62 65 20 |he actio|n to be |
|00005050| 70 65 72 66 6f 72 6d 65 | 64 2e 2e 2e 0d 0a 20 20 |performe|d..... |
|00005060| 20 70 75 62 6c 69 63 20 | 76 6f 69 64 20 69 74 65 | public |void ite|
|00005070| 6d 53 74 61 74 65 43 68 | 61 6e 67 65 64 28 49 74 |mStateCh|anged(It|
|00005080| 65 6d 45 76 65 6e 74 20 | 65 29 20 7b 0d 0a 20 20 |emEvent |e) {.. |
|00005090| 20 20 20 20 20 64 6c 67 | 2e 70 61 69 6e 74 53 61 | dlg|.paintSa|
|000050a0| 6d 70 6c 65 28 29 3b 0d | 0a 20 20 20 7d 0d 0a 7d |mple();.|. }..}|
|000050b0| 0d 0a 63 6c 61 73 73 20 | 43 68 6f 6f 73 65 41 63 |..class |ChooseAc|
|000050c0| 74 69 6f 6e 4c 69 73 74 | 65 6e 65 72 20 69 6d 70 |tionList|ener imp|
|000050d0| 6c 65 6d 65 6e 74 73 20 | 41 63 74 69 6f 6e 4c 69 |lements |ActionLi|
|000050e0| 73 74 65 6e 65 72 20 7b | 0d 0a 20 20 20 2f 2f 20 |stener {|.. // |
|000050f0| 41 63 74 69 6f 6e 73 20 | 6f 6e 20 74 68 65 20 64 |Actions |on the d|
|00005100| 69 61 6c 6f 67 2e 2e 2e | 0d 0a 20 20 20 43 68 6f |ialog...|.. Cho|
|00005110| 6f 73 65 46 6f 6e 74 44 | 69 61 6c 6f 67 20 64 6c |oseFontD|ialog dl|
|00005120| 67 3b 20 2f 2f 20 54 68 | 65 20 63 6f 6c 6f 72 20 |g; // Th|e color |
|00005130| 64 69 61 6c 6f 67 2e 2e | 2e 0d 0a 20 20 20 2f 2f |dialog..|... //|
|00005140| 20 43 6f 6e 73 74 72 75 | 63 74 6f 72 2e 2e 2e 0d | Constru|ctor....|
|00005150| 0a 20 20 20 70 75 62 6c | 69 63 20 43 68 6f 6f 73 |. publ|ic Choos|
|00005160| 65 41 63 74 69 6f 6e 4c | 69 73 74 65 6e 65 72 28 |eActionL|istener(|
|00005170| 43 68 6f 6f 73 65 46 6f | 6e 74 44 69 61 6c 6f 67 |ChooseFo|ntDialog|
|00005180| 20 64 6c 67 29 20 7b 0d | 0a 20 20 20 20 20 20 74 | dlg) {.|. t|
|00005190| 68 69 73 2e 64 6c 67 20 | 3d 20 64 6c 67 3b 0d 0a |his.dlg |= dlg;..|
|000051a0| 20 20 20 7d 0d 0a 20 20 | 20 2f 2f 20 4a 75 73 74 | }.. | // Just|
|000051b0| 20 73 68 75 74 64 6f 77 | 6e 2e 2e 2e 0d 0a 20 20 | shutdow|n..... |
|000051c0| 20 70 75 62 6c 69 63 20 | 76 6f 69 64 20 61 63 74 | public |void act|
|000051d0| 69 6f 6e 50 65 72 66 6f | 72 6d 65 64 28 41 63 74 |ionPerfo|rmed(Act|
|000051e0| 69 6f 6e 45 76 65 6e 74 | 20 65 29 20 7b 0d 0a 20 |ionEvent| e) {.. |
|000051f0| 20 20 20 20 20 64 6c 67 | 2e 64 69 73 70 6f 73 65 | dlg|.dispose|
|00005200| 28 29 3b 0d 0a 20 20 20 | 7d 0d 0a 7d 0d 0a 0d 0a |();.. |}..}....|
|00005210| 2f 2f 20 44 69 61 6c 6f | 67 20 62 6f 78 20 66 6f |// Dialo|g box fo|
|00005220| 72 20 63 68 6f 6f 73 69 | 6e 67 20 64 69 73 70 6c |r choosi|ng displ|
|00005230| 61 79 20 63 6f 6c 6f 72 | 73 2e 2e 2e 0d 0a 63 6c |ay color|s.....cl|
|00005240| 61 73 73 20 43 68 6f 6f | 73 65 46 6f 6e 74 44 69 |ass Choo|seFontDi|
|00005250| 61 6c 6f 67 20 65 78 74 | 65 6e 64 73 20 44 69 61 |alog ext|ends Dia|
|00005260| 6c 6f 67 20 7b 0d 0a 20 | 20 20 4c 69 73 74 20 63 |log {.. | List c|
|00005270| 68 6f 69 63 65 4c 69 73 | 74 3b 20 20 2f 2f 20 4c |hoiceLis|t; // L|
|00005280| 69 73 74 20 6f 66 20 63 | 6f 6c 6f 72 20 63 68 6f |ist of c|olor cho|
|00005290| 69 63 65 73 2e 2e 2e 0d | 0a 20 20 20 66 6f 6e 74 |ices....|. font|
|000052a0| 44 69 73 70 6c 61 79 20 | 64 3b 20 2f 2f 20 54 68 |Display |d; // Th|
|000052b0| 69 73 20 69 73 20 74 68 | 65 20 74 65 78 74 20 64 |is is th|e text d|
|000052c0| 69 73 70 6c 61 79 2e 2e | 2e 0d 0a 20 20 20 43 68 |isplay..|... Ch|
|000052d0| 6f 69 63 65 20 63 68 6f | 69 63 65 53 69 7a 65 3b |oice cho|iceSize;|
|000052e0| 20 20 2f 2f 20 53 69 7a | 65 20 6f 66 20 66 6f 6e | // Siz|e of fon|
|000052f0| 74 2e 2e 2e 0d 0a 20 20 | 20 43 68 65 63 6b 62 6f |t..... | Checkbo|
|00005300| 78 20 63 68 65 63 6b 49 | 74 61 6c 69 63 73 3b 0d |x checkI|talics;.|
|00005310| 0a 20 20 20 43 68 65 63 | 6b 62 6f 78 20 63 68 65 |. Chec|kbox che|
|00005320| 63 6b 42 6f 6c 64 3b 0d | 0a 20 20 20 46 72 61 6d |ckBold;.|. Fram|
|00005330| 65 20 66 72 3b 0d 0a 20 | 20 20 46 6f 6e 74 20 63 |e fr;.. | Font c|
|00005340| 75 72 72 65 6e 74 46 6f | 6e 74 3b 20 20 2f 2f 20 |urrentFo|nt; // |
|00005350| 43 75 72 72 65 6e 74 20 | 66 6f 6e 74 20 69 6e 20 |Current |font in |
|00005360| 73 61 6d 70 6c 65 2e 2e | 2e 0d 0a 20 20 20 46 6f |sample..|... Fo|
|00005370| 6e 74 20 64 65 66 61 75 | 6c 74 46 6f 6e 74 3b 20 |nt defau|ltFont; |
|00005380| 2f 2f 20 53 74 6f 72 65 | 20 66 6f 6e 74 20 64 69 |// Store| font di|
|00005390| 61 6c 6f 67 20 77 61 73 | 20 63 72 65 61 74 65 64 |alog was| created|
|000053a0| 20 77 69 74 68 2e 2e 2e | 0d 0a 20 20 20 2f 2f 20 | with...|.. // |
|000053b0| 43 6f 6e 73 74 72 75 63 | 74 20 64 69 61 6c 6f 67 |Construc|t dialog|
|000053c0| 20 74 6f 20 61 6c 6c 6f | 77 20 63 6f 6c 6f 72 20 | to allo|w color |
|000053d0| 74 6f 20 62 65 20 63 68 | 6f 73 65 6e 2e 2e 2e 0d |to be ch|osen....|
|000053e0| 0a 09 70 75 62 6c 69 63 | 20 43 68 6f 6f 73 65 46 |..public| ChooseF|
|000053f0| 6f 6e 74 44 69 61 6c 6f | 67 28 46 72 61 6d 65 20 |ontDialo|g(Frame |
|00005400| 70 61 72 65 6e 74 2c 62 | 6f 6f 6c 65 61 6e 20 6d |parent,b|oolean m|
|00005410| 6f 64 61 6c 29 20 7b 0d | 0a 20 20 20 20 20 20 2f |odal) {.|. /|
|00005420| 2f 20 43 72 65 61 74 65 | 20 64 69 61 6c 6f 67 20 |/ Create| dialog |
|00005430| 77 69 74 68 20 74 69 74 | 6c 65 0d 0a 20 20 20 20 |with tit|le.. |
|00005440| 20 20 73 75 70 65 72 28 | 70 61 72 65 6e 74 2c 22 | super(|parent,"|
|00005450| 46 6f 6e 74 20 44 69 61 | 6c 6f 67 22 2c 6d 6f 64 |Font Dia|log",mod|
|00005460| 61 6c 29 3b 0d 0a 20 20 | 20 20 20 20 66 72 20 3d |al);.. | fr =|
|00005470| 20 70 61 72 65 6e 74 3b | 0d 0a 20 20 20 20 20 20 | parent;|.. |
|00005480| 64 65 66 61 75 6c 74 46 | 6f 6e 74 20 3d 20 67 65 |defaultF|ont = ge|
|00005490| 74 46 6f 6e 74 28 29 3b | 0d 0a 20 20 20 20 20 20 |tFont();|.. |
|000054a0| 2f 2f 20 43 72 65 61 74 | 65 20 74 68 65 20 64 69 |// Creat|e the di|
|000054b0| 61 6c 6f 67 20 63 6f 6d | 70 6f 6e 65 6e 74 73 2e |alog com|ponents.|
|000054c0| 2e 2e 0d 0a 20 20 20 20 | 20 20 63 72 65 61 74 65 |.... | create|
|000054d0| 43 6f 6d 70 6f 6e 65 6e | 74 73 28 29 3b 0d 0a 09 |Componen|ts();...|
|000054e0| 7d 0d 0a 0d 0a 20 20 20 | 2f 2f 20 47 65 74 20 74 |}.... |// Get t|
|000054f0| 68 65 20 64 65 66 61 75 | 6c 74 20 66 6f 6e 74 20 |he defau|lt font |
|00005500| 61 6e 64 20 73 65 74 20 | 75 70 20 64 69 73 70 6c |and set |up displ|
|00005510| 61 79 2e 2e 2e 0d 0a 20 | 20 20 70 72 69 76 61 74 |ay..... | privat|
|00005520| 65 20 76 6f 69 64 20 73 | 65 74 44 65 66 61 75 6c |e void s|etDefaul|
|00005530| 74 46 6f 6e 74 28 29 20 | 7b 0d 0a 20 20 20 20 20 |tFont() |{.. |
|00005540| 20 2f 2f 20 47 65 74 20 | 74 68 65 20 6c 61 74 65 | // Get |the late|
|00005550| 73 74 20 66 6f 6e 74 2e | 2e 2e 0d 0a 20 20 20 20 |st font.|.... |
|00005560| 20 20 63 75 72 72 65 6e | 74 46 6f 6e 74 20 3d 20 | curren|tFont = |
|00005570| 67 65 74 46 6f 6e 74 28 | 29 3b 0d 0a 20 20 20 20 |getFont(|);.. |
|00005580| 20 20 2f 2f 20 47 65 74 | 20 64 65 66 61 75 6c 74 | // Get| default|
|00005590| 20 6c 69 73 74 2e 2e 2e | 0d 0a 20 20 20 20 20 20 | list...|.. |
|000055a0| 53 74 72 69 6e 67 20 73 | 20 3d 20 63 75 72 72 65 |String s| = curre|
|000055b0| 6e 74 46 6f 6e 74 2e 67 | 65 74 4e 61 6d 65 28 29 |ntFont.g|etName()|
|000055c0| 3b 0d 0a 20 20 20 20 20 | 20 69 6e 74 20 69 6e 64 |;.. | int ind|
|000055d0| 65 78 20 3d 20 66 69 6e | 64 4c 69 73 74 53 74 72 |ex = fin|dListStr|
|000055e0| 69 6e 67 28 63 68 6f 69 | 63 65 4c 69 73 74 2c 73 |ing(choi|ceList,s|
|000055f0| 29 3b 0d 0a 20 20 20 20 | 20 20 69 66 20 28 69 6e |);.. | if (in|
|00005600| 64 65 78 20 3e 3d 20 30 | 29 0d 0a 20 20 20 20 20 |dex >= 0|).. |
|00005610| 20 20 20 20 20 20 20 63 | 68 6f 69 63 65 4c 69 73 | c|hoiceLis|
|00005620| 74 2e 73 65 6c 65 63 74 | 28 69 6e 64 65 78 29 3b |t.select|(index);|
|00005630| 0d 0a 20 20 20 20 20 20 | 65 6c 73 65 0d 0a 20 20 |.. |else.. |
|00005640| 20 20 20 20 20 20 20 20 | 20 20 63 68 6f 69 63 65 | | choice|
|00005650| 4c 69 73 74 2e 73 65 6c | 65 63 74 28 30 29 3b 0d |List.sel|ect(0);.|
|00005660| 0a 20 20 20 20 20 20 2f | 2f 20 47 65 74 20 64 65 |. /|/ Get de|
|00005670| 66 61 75 6c 74 20 73 69 | 7a 65 0d 0a 20 20 20 20 |fault si|ze.. |
|00005680| 20 20 69 6e 74 20 73 69 | 7a 65 46 6f 6e 74 20 3d | int si|zeFont =|
|00005690| 20 63 75 72 72 65 6e 74 | 46 6f 6e 74 2e 67 65 74 | current|Font.get|
|000056a0| 53 69 7a 65 28 29 3b 0d | 0a 20 20 20 20 20 20 69 |Size();.|. i|
|000056b0| 6e 64 65 78 20 3d 20 66 | 69 6e 64 43 68 6f 69 63 |ndex = f|indChoic|
|000056c0| 65 53 74 72 69 6e 67 28 | 63 68 6f 69 63 65 53 69 |eString(|choiceSi|
|000056d0| 7a 65 2c 0d 0a 20 20 20 | 20 20 20 20 20 20 53 74 |ze,.. | St|
|000056e0| 72 69 6e 67 2e 76 61 6c | 75 65 4f 66 28 73 69 7a |ring.val|ueOf(siz|
|000056f0| 65 46 6f 6e 74 29 29 3b | 0d 0a 20 20 20 20 20 20 |eFont));|.. |
|00005700| 69 66 20 28 69 6e 64 65 | 78 20 3e 3d 20 30 29 0d |if (inde|x >= 0).|
|00005710| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 63 68 6f |. | cho|
|00005720| 69 63 65 53 69 7a 65 2e | 73 65 6c 65 63 74 28 69 |iceSize.|select(i|
|00005730| 6e 64 65 78 29 3b 0d 0a | 20 20 20 20 20 20 65 6c |ndex);..| el|
|00005740| 73 65 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |se.. | |
|00005750| 63 68 6f 69 63 65 53 69 | 7a 65 2e 73 65 6c 65 63 |choiceSi|ze.selec|
|00005760| 74 28 30 29 3b 0d 0a 20 | 20 20 20 20 20 2f 2f 20 |t(0);.. | // |
|00005770| 53 65 74 20 74 68 65 20 | 73 74 79 6c 65 20 64 69 |Set the |style di|
|00005780| 73 70 6c 61 79 73 2e 2e | 2e 0d 0a 20 20 20 20 20 |splays..|... |
|00005790| 20 69 6e 74 20 73 74 79 | 6c 65 46 6f 6e 74 20 3d | int sty|leFont =|
|000057a0| 20 63 75 72 72 65 6e 74 | 46 6f 6e 74 2e 67 65 74 | current|Font.get|
|000057b0| 53 74 79 6c 65 28 29 3b | 0d 0a 20 20 20 20 20 20 |Style();|.. |
|000057c0| 69 66 20 28 28 73 74 79 | 6c 65 46 6f 6e 74 20 26 |if ((sty|leFont &|
|000057d0| 20 46 6f 6e 74 2e 42 4f | 4c 44 29 20 21 3d 20 30 | Font.BO|LD) != 0|
|000057e0| 29 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |).. | |
|000057f0| 63 68 65 63 6b 42 6f 6c | 64 2e 73 65 74 53 74 61 |checkBol|d.setSta|
|00005800| 74 65 28 74 72 75 65 29 | 3b 0d 0a 20 20 20 20 20 |te(true)|;.. |
|00005810| 20 65 6c 73 65 0d 0a 20 | 20 20 20 20 20 20 20 20 | else.. | |
|00005820| 20 20 20 20 63 68 65 63 | 6b 42 6f 6c 64 2e 73 65 | chec|kBold.se|
|00005830| 74 53 74 61 74 65 28 66 | 61 6c 73 65 29 3b 0d 0a |tState(f|alse);..|
|00005840| 20 20 20 20 20 20 69 66 | 20 28 28 73 74 79 6c 65 | if| ((style|
|00005850| 46 6f 6e 74 20 26 20 46 | 6f 6e 74 2e 49 54 41 4c |Font & F|ont.ITAL|
|00005860| 49 43 29 20 21 3d 20 30 | 29 0d 0a 20 20 20 20 20 |IC) != 0|).. |
|00005870| 20 20 20 20 20 20 20 20 | 63 68 65 63 6b 49 74 61 | |checkIta|
|00005880| 6c 69 63 73 2e 73 65 74 | 53 74 61 74 65 28 74 72 |lics.set|State(tr|
|00005890| 75 65 29 3b 0d 0a 20 20 | 20 20 20 20 65 6c 73 65 |ue);.. | else|
|000058a0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 63 |.. | c|
|000058b0| 68 65 63 6b 49 74 61 6c | 69 63 73 2e 73 65 74 53 |heckItal|ics.setS|
|000058c0| 74 61 74 65 28 66 61 6c | 73 65 29 3b 0d 0a 20 20 |tate(fal|se);.. |
|000058d0| 20 20 20 20 2f 2f 20 53 | 65 74 20 74 68 65 20 63 | // S|et the c|
|000058e0| 61 6e 76 61 73 20 73 74 | 79 6c 65 2e 2e 2e 0d 0a |anvas st|yle.....|
|000058f0| 20 20 20 20 20 20 64 2e | 73 65 74 46 6f 6e 74 28 | d.|setFont(|
|00005900| 63 75 72 72 65 6e 74 46 | 6f 6e 74 29 3b 0d 0a 20 |currentF|ont);.. |
|00005910| 20 20 7d 0d 0a 0d 0a 20 | 20 20 2f 2f 20 54 68 65 | }.... | // The|
|00005920| 20 6c 61 79 6f 75 74 20 | 77 69 6c 6c 20 63 61 6c | layout |will cal|
|00005930| 6c 20 74 68 69 73 20 74 | 6f 20 67 65 74 20 74 68 |l this t|o get th|
|00005940| 65 20 70 72 65 66 65 72 | 72 65 64 20 73 69 7a 65 |e prefer|red size|
|00005950| 0d 0a 20 20 20 2f 2f 20 | 6f 66 20 74 68 65 20 64 |.. // |of the d|
|00005960| 69 61 6c 6f 67 2e 20 20 | 4d 61 6b 65 20 69 74 20 |ialog. |Make it |
|00005970| 62 69 67 20 65 6e 6f 75 | 67 68 20 66 6f 72 20 74 |big enou|gh for t|
|00005980| 68 65 20 6c 69 73 74 62 | 6f 78 20 74 65 78 74 0d |he listb|ox text.|
|00005990| 0a 20 20 20 2f 2f 20 74 | 68 65 20 63 68 65 63 6b |. // t|he check|
|000059a0| 62 6f 78 65 73 2c 20 63 | 61 6e 76 61 73 2c 20 61 |boxes, c|anvas, a|
|000059b0| 6e 64 20 62 75 74 74 6f | 6e 73 2e 2e 2e 0d 0a 20 |nd butto|ns..... |
|000059c0| 20 20 70 75 62 6c 69 63 | 20 44 69 6d 65 6e 73 69 | public| Dimensi|
|000059d0| 6f 6e 20 70 72 65 66 65 | 72 72 65 64 53 69 7a 65 |on prefe|rredSize|
|000059e0| 28 29 20 7b 0d 0a 20 20 | 20 20 20 20 2f 2f 20 47 |() {.. | // G|
|000059f0| 65 74 20 74 68 65 20 6d | 65 74 72 69 63 73 20 6f |et the m|etrics o|
|00005a00| 66 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 66 6f |f the cu|rrent fo|
|00005a10| 6e 74 2e 2e 2e 0d 0a 20 | 20 20 20 20 20 46 6f 6e |nt..... | Fon|
|00005a20| 74 4d 65 74 72 69 63 73 | 20 66 6d 20 3d 20 67 65 |tMetrics| fm = ge|
|00005a30| 74 46 6f 6e 74 4d 65 74 | 72 69 63 73 28 67 65 74 |tFontMet|rics(get|
|00005a40| 46 6f 6e 74 28 29 29 3b | 0d 0a 20 20 20 20 20 20 |Font());|.. |
|00005a50| 69 6e 74 20 77 69 64 74 | 68 20 3d 20 33 20 2a 20 |int widt|h = 3 * |
|00005a60| 66 6d 2e 73 74 72 69 6e | 67 57 69 64 74 68 28 22 |fm.strin|gWidth("|
|00005a70| 48 69 67 68 6c 69 67 68 | 74 65 64 20 66 6f 72 65 |Highligh|ted fore|
|00005a80| 67 72 6f 75 6e 64 22 29 | 3b 0d 0a 20 20 20 20 20 |ground")|;.. |
|00005a90| 20 69 6e 74 20 68 65 69 | 67 68 74 20 3d 20 31 34 | int hei|ght = 14|
|00005aa0| 20 2a 20 66 6d 2e 67 65 | 74 48 65 69 67 68 74 28 | * fm.ge|tHeight(|
|00005ab0| 29 3b 0d 0a 20 20 20 20 | 20 20 72 65 74 75 72 6e |);.. | return|
|00005ac0| 20 6e 65 77 20 44 69 6d | 65 6e 73 69 6f 6e 28 77 | new Dim|ension(w|
|00005ad0| 69 64 74 68 20 2b 20 34 | 30 2c 68 65 69 67 68 74 |idth + 4|0,height|
|00005ae0| 20 2b 20 34 30 29 3b 0d | 0a 20 20 20 7d 0d 0a 0d | + 40);.|. }...|
|00005af0| 0a 20 20 20 2f 2f 20 43 | 72 65 61 74 65 20 74 68 |. // C|reate th|
|00005b00| 65 20 6d 61 69 6e 20 64 | 69 73 70 6c 61 79 20 70 |e main d|isplay p|
|00005b10| 61 6e 65 6c 2e 2e 2e 0d | 0a 20 20 20 70 72 69 76 |anel....|. priv|
|00005b20| 61 74 65 20 76 6f 69 64 | 20 63 72 65 61 74 65 43 |ate void| createC|
|00005b30| 6f 6d 70 6f 6e 65 6e 74 | 73 28 29 20 7b 0d 0a 20 |omponent|s() {.. |
|00005b40| 20 20 20 2f 2f 20 55 73 | 65 20 67 72 69 64 62 61 | // Us|e gridba|
|00005b50| 67 20 63 6f 6e 73 74 72 | 61 69 6e 74 73 2e 2e 2e |g constr|aints...|
|00005b60| 0d 0a 20 20 20 20 47 72 | 69 64 42 61 67 4c 61 79 |.. Gr|idBagLay|
|00005b70| 6f 75 74 20 67 20 3d 20 | 6e 65 77 20 47 72 69 64 |out g = |new Grid|
|00005b80| 42 61 67 4c 61 79 6f 75 | 74 28 29 3b 0d 0a 20 20 |BagLayou|t();.. |
|00005b90| 20 20 73 65 74 4c 61 79 | 6f 75 74 28 67 29 3b 0d | setLay|out(g);.|
|00005ba0| 0a 09 47 72 69 64 42 61 | 67 43 6f 6e 73 74 72 61 |..GridBa|gConstra|
|00005bb0| 69 6e 74 73 20 67 62 63 | 20 3d 20 6e 65 77 20 47 |ints gbc| = new G|
|00005bc0| 72 69 64 42 61 67 43 6f | 6e 73 74 72 61 69 6e 74 |ridBagCo|nstraint|
|00005bd0| 73 28 29 3b 0d 0a 20 20 | 20 20 2f 2f 20 53 65 74 |s();.. | // Set|
|00005be0| 20 74 68 65 20 63 6f 6e | 73 74 72 61 69 6e 74 73 | the con|straints|
|00005bf0| 20 66 6f 72 20 74 68 65 | 20 74 6f 70 20 6f 62 6a | for the| top obj|
|00005c00| 65 63 74 73 2e 2e 2e 0d | 0a 09 67 62 63 2e 66 69 |ects....|..gbc.fi|
|00005c10| 6c 6c 20 3d 20 47 72 69 | 64 42 61 67 43 6f 6e 73 |ll = Gri|dBagCons|
|00005c20| 74 72 61 69 6e 74 73 2e | 42 4f 54 48 3b 0d 0a 09 |traints.|BOTH;...|
|00005c30| 67 62 63 2e 77 65 69 67 | 68 74 78 20 3d 20 31 2e |gbc.weig|htx = 1.|
|00005c40| 30 3b 0d 0a 09 67 62 63 | 2e 77 65 69 67 68 74 79 |0;...gbc|.weighty|
|00005c50| 20 3d 20 31 2e 30 3b 0d | 0a 09 67 62 63 2e 67 72 | = 1.0;.|..gbc.gr|
|00005c60| 69 64 68 65 69 67 68 74 | 20 3d 20 31 30 3b 0d 0a |idheight| = 10;..|
|00005c70| 20 20 20 20 2f 2f 20 41 | 64 64 20 74 68 65 20 6c | // A|dd the l|
|00005c80| 69 73 74 62 6f 78 20 6f | 66 20 63 68 6f 69 63 65 |istbox o|f choice|
|00005c90| 73 2e 2e 2e 0d 0a 20 20 | 20 20 2f 2f 20 47 65 74 |s..... | // Get|
|00005ca0| 20 74 68 65 20 73 65 6c | 65 63 74 69 6f 6e 20 66 | the sel|ection f|
|00005cb0| 72 6f 6d 20 74 68 65 20 | 74 6f 6f 6c 6b 69 74 2e |rom the |toolkit.|
|00005cc0| 2e 2e 0d 0a 20 20 20 20 | 63 68 6f 69 63 65 4c 69 |.... |choiceLi|
|00005cd0| 73 74 20 3d 20 6e 65 77 | 20 4c 69 73 74 28 29 3b |st = new| List();|
|00005ce0| 0d 0a 20 20 20 20 53 74 | 72 69 6e 67 20 66 6f 6e |.. St|ring fon|
|00005cf0| 74 4c 69 73 74 5b 5d 20 | 3d 20 54 6f 6f 6c 6b 69 |tList[] |= Toolki|
|00005d00| 74 2e 67 65 74 44 65 66 | 61 75 6c 74 54 6f 6f 6c |t.getDef|aultTool|
|00005d10| 6b 69 74 28 29 2e 67 65 | 74 46 6f 6e 74 4c 69 73 |kit().ge|tFontLis|
|00005d20| 74 28 29 3b 0d 0a 20 20 | 20 20 66 6f 72 20 28 69 |t();.. | for (i|
|00005d30| 6e 74 20 69 20 3d 20 30 | 3b 20 69 20 3c 20 66 6f |nt i = 0|; i < fo|
|00005d40| 6e 74 4c 69 73 74 2e 6c | 65 6e 67 74 68 3b 20 2b |ntList.l|ength; +|
|00005d50| 2b 69 29 20 7b 0d 0a 20 | 20 20 20 20 20 20 63 68 |+i) {.. | ch|
|00005d60| 6f 69 63 65 4c 69 73 74 | 2e 61 64 64 49 74 65 6d |oiceList|.addItem|
|00005d70| 28 66 6f 6e 74 4c 69 73 | 74 5b 69 5d 29 3b 20 0d |(fontLis|t[i]); .|
|00005d80| 0a 20 20 20 20 7d 20 2f | 2f 20 65 6e 64 20 69 66 |. } /|/ end if|
|00005d90| 0d 0a 09 67 2e 73 65 74 | 43 6f 6e 73 74 72 61 69 |...g.set|Constrai|
|00005da0| 6e 74 73 28 63 68 6f 69 | 63 65 4c 69 73 74 2c 67 |nts(choi|ceList,g|
|00005db0| 62 63 29 3b 0d 0a 09 61 | 64 64 28 63 68 6f 69 63 |bc);...a|dd(choic|
|00005dc0| 65 4c 69 73 74 29 3b 0d | 0a 20 20 20 20 2f 2f 20 |eList);.|. // |
|00005dd0| 53 65 74 20 74 68 65 20 | 64 65 66 61 75 6c 74 20 |Set the |default |
|00005de0| 76 61 6c 75 65 73 2e 2e | 2e 0d 0a 09 67 62 63 2e |values..|....gbc.|
|00005df0| 77 65 69 67 68 74 79 20 | 3d 20 30 2e 30 3b 0d 0a |weighty |= 0.0;..|
|00005e00| 09 67 62 63 2e 77 65 69 | 67 68 74 78 20 3d 20 31 |.gbc.wei|ghtx = 1|
|00005e10| 2e 30 3b 0d 0a 09 67 62 | 63 2e 67 72 69 64 68 65 |.0;...gb|c.gridhe|
|00005e20| 69 67 68 74 20 3d 20 31 | 3b 0d 0a 09 67 62 63 2e |ight = 1|;...gbc.|
|00005e30| 67 72 69 64 77 69 64 74 | 68 20 3d 20 47 72 69 64 |gridwidt|h = Grid|
|00005e40| 42 61 67 43 6f 6e 73 74 | 72 61 69 6e 74 73 2e 52 |BagConst|raints.R|
|00005e50| 45 4d 41 49 4e 44 45 52 | 3b 0d 0a 20 20 20 20 2f |EMAINDER|;.. /|
|00005e60| 2f 20 43 72 65 61 74 65 | 20 61 20 6c 61 62 65 6c |/ Create| a label|
|00005e70| 20 66 6f 72 20 64 69 73 | 70 6c 61 79 2e 2e 2e 0d | for dis|play....|
|00005e80| 0a 20 20 20 20 4c 61 62 | 65 6c 20 6c 20 3d 20 6e |. Lab|el l = n|
|00005e90| 65 77 20 4c 61 62 65 6c | 28 22 53 69 7a 65 3a 22 |ew Label|("Size:"|
|00005ea0| 29 3b 0d 0a 20 20 20 20 | 2f 2f 20 41 64 64 20 74 |);.. |// Add t|
|00005eb0| 6f 20 67 72 69 64 20 62 | 61 67 2e 2e 2e 0d 0a 09 |o grid b|ag......|
|00005ec0| 67 2e 73 65 74 43 6f 6e | 73 74 72 61 69 6e 74 73 |g.setCon|straints|
|00005ed0| 28 6c 2c 67 62 63 29 3b | 0d 0a 20 20 20 20 61 64 |(l,gbc);|.. ad|
|00005ee0| 64 28 6c 29 3b 0d 0a 20 | 20 20 20 2f 2f 20 43 72 |d(l);.. | // Cr|
|00005ef0| 65 61 74 65 20 74 68 65 | 20 63 68 6f 69 63 65 20 |eate the| choice |
|00005f00| 62 6f 78 2e 2e 2e 0d 0a | 20 20 20 20 63 68 6f 69 |box.....| choi|
|00005f10| 63 65 53 69 7a 65 20 3d | 20 6e 65 77 20 43 68 6f |ceSize =| new Cho|
|00005f20| 69 63 65 28 29 3b 0d 0a | 20 20 20 20 63 68 6f 69 |ice();..| choi|
|00005f30| 63 65 53 69 7a 65 2e 61 | 64 64 49 74 65 6d 28 22 |ceSize.a|ddItem("|
|00005f40| 38 22 29 3b 0d 0a 20 20 | 20 20 63 68 6f 69 63 65 |8");.. | choice|
|00005f50| 53 69 7a 65 2e 61 64 64 | 49 74 65 6d 28 22 31 30 |Size.add|Item("10|
|00005f60| 22 29 3b 0d 0a 20 20 20 | 20 63 68 6f 69 63 65 53 |");.. | choiceS|
|00005f70| 69 7a 65 2e 61 64 64 49 | 74 65 6d 28 22 31 32 22 |ize.addI|tem("12"|
|00005f80| 29 3b 0d 0a 20 20 20 20 | 63 68 6f 69 63 65 53 69 |);.. |choiceSi|
|00005f90| 7a 65 2e 61 64 64 49 74 | 65 6d 28 22 31 34 22 29 |ze.addIt|em("14")|
|00005fa0| 3b 0d 0a 20 20 20 20 63 | 68 6f 69 63 65 53 69 7a |;.. c|hoiceSiz|
|00005fb0| 65 2e 61 64 64 49 74 65 | 6d 28 22 31 36 22 29 3b |e.addIte|m("16");|
|00005fc0| 0d 0a 20 20 20 20 63 68 | 6f 69 63 65 53 69 7a 65 |.. ch|oiceSize|
|00005fd0| 2e 61 64 64 49 74 65 6d | 28 22 32 30 22 29 3b 0d |.addItem|("20");.|
|00005fe0| 0a 20 20 20 20 2f 2f 20 | 41 64 64 20 74 6f 20 67 |. // |Add to g|
|00005ff0| 72 69 64 20 62 61 67 2e | 2e 2e 0d 0a 09 20 67 2e |rid bag.|..... g.|
|00006000| 73 65 74 43 6f 6e 73 74 | 72 61 69 6e 74 73 28 63 |setConst|raints(c|
|00006010| 68 6f 69 63 65 53 69 7a | 65 2c 67 62 63 29 3b 0d |hoiceSiz|e,gbc);.|
|00006020| 0a 20 20 20 20 61 64 64 | 28 63 68 6f 69 63 65 53 |. add|(choiceS|
|00006030| 69 7a 65 29 3b 0d 0a 20 | 20 20 20 2f 2f 20 41 64 |ize);.. | // Ad|
|00006040| 64 20 49 74 61 6c 69 63 | 73 2e 2e 2e 0d 0a 20 20 |d Italic|s..... |
|00006050| 20 20 63 68 65 63 6b 49 | 74 61 6c 69 63 73 20 3d | checkI|talics =|
|00006060| 20 6e 65 77 20 43 68 65 | 63 6b 62 6f 78 28 22 49 | new Che|ckbox("I|
|00006070| 74 61 6c 69 63 73 22 29 | 3b 0d 0a 09 20 67 2e 73 |talics")|;... g.s|
|00006080| 65 74 43 6f 6e 73 74 72 | 61 69 6e 74 73 28 63 68 |etConstr|aints(ch|
|00006090| 65 63 6b 49 74 61 6c 69 | 63 73 2c 67 62 63 29 3b |eckItali|cs,gbc);|
|000060a0| 0d 0a 20 20 20 20 61 64 | 64 28 63 68 65 63 6b 49 |.. ad|d(checkI|
|000060b0| 74 61 6c 69 63 73 29 3b | 0d 0a 20 20 20 20 2f 2f |talics);|.. //|
|000060c0| 20 41 64 64 20 42 6f 6c | 64 2e 2e 2e 0d 0a 20 20 | Add Bol|d..... |
|000060d0| 20 20 63 68 65 63 6b 42 | 6f 6c 64 20 3d 20 6e 65 | checkB|old = ne|
|000060e0| 77 20 43 68 65 63 6b 62 | 6f 78 28 22 42 6f 6c 64 |w Checkb|ox("Bold|
|000060f0| 22 29 3b 0d 0a 09 20 67 | 2e 73 65 74 43 6f 6e 73 |");... g|.setCons|
|00006100| 74 72 61 69 6e 74 73 28 | 63 68 65 63 6b 42 6f 6c |traints(|checkBol|
|00006110| 64 2c 67 62 63 29 3b 0d | 0a 20 20 20 20 61 64 64 |d,gbc);.|. add|
|00006120| 28 63 68 65 63 6b 42 6f | 6c 64 29 3b 0d 0a 20 20 |(checkBo|ld);.. |
|00006130| 20 20 2f 2f 20 53 65 74 | 20 6c 69 73 74 65 6e 65 | // Set| listene|
|00006140| 72 73 2e 2e 2e 0d 0a 20 | 20 20 20 46 6f 6e 74 49 |rs..... | FontI|
|00006150| 74 65 6d 4c 69 73 74 65 | 6e 65 72 20 69 74 65 6d |temListe|ner item|
|00006160| 4c 69 73 74 65 6e 65 72 | 20 3d 20 6e 65 77 20 46 |Listener| = new F|
|00006170| 6f 6e 74 49 74 65 6d 4c | 69 73 74 65 6e 65 72 28 |ontItemL|istener(|
|00006180| 74 68 69 73 29 3b 0d 0a | 20 20 20 20 63 68 6f 69 |this);..| choi|
|00006190| 63 65 4c 69 73 74 2e 61 | 64 64 49 74 65 6d 4c 69 |ceList.a|ddItemLi|
|000061a0| 73 74 65 6e 65 72 28 69 | 74 65 6d 4c 69 73 74 65 |stener(i|temListe|
|000061b0| 6e 65 72 29 3b 0d 0a 20 | 20 20 20 63 68 6f 69 63 |ner);.. | choic|
|000061c0| 65 53 69 7a 65 2e 61 64 | 64 49 74 65 6d 4c 69 73 |eSize.ad|dItemLis|
|000061d0| 74 65 6e 65 72 28 69 74 | 65 6d 4c 69 73 74 65 6e |tener(it|emListen|
|000061e0| 65 72 29 3b 0d 0a 20 20 | 20 20 63 68 65 63 6b 49 |er);.. | checkI|
|000061f0| 74 61 6c 69 63 73 2e 61 | 64 64 49 74 65 6d 4c 69 |talics.a|ddItemLi|
|00006200| 73 74 65 6e 65 72 28 69 | 74 65 6d 4c 69 73 74 65 |stener(i|temListe|
|00006210| 6e 65 72 29 3b 0d 0a 20 | 20 20 20 63 68 65 63 6b |ner);.. | check|
|00006220| 42 6f 6c 64 2e 61 64 64 | 49 74 65 6d 4c 69 73 74 |Bold.add|ItemList|
|00006230| 65 6e 65 72 28 69 74 65 | 6d 4c 69 73 74 65 6e 65 |ener(ite|mListene|
|00006240| 72 29 3b 0d 0a 20 20 20 | 20 2f 2f 20 44 69 73 70 |r);.. | // Disp|
|00006250| 6c 61 79 20 74 68 65 20 | 63 6f 6c 6f 72 20 63 68 |lay the |color ch|
|00006260| 6f 73 65 6e 2e 2e 2e 0d | 0a 20 20 20 20 64 20 3d |osen....|. d =|
|00006270| 20 6e 65 77 20 66 6f 6e | 74 44 69 73 70 6c 61 79 | new fon|tDisplay|
|00006280| 28 22 53 61 6d 70 6c 65 | 20 54 65 78 74 22 29 3b |("Sample| Text");|
|00006290| 0d 0a 20 20 20 20 2f 2f | 20 41 64 64 20 74 6f 20 |.. //| Add to |
|000062a0| 67 72 69 64 20 62 61 67 | 2e 2e 2e 0d 0a 09 67 2e |grid bag|......g.|
|000062b0| 73 65 74 43 6f 6e 73 74 | 72 61 69 6e 74 73 28 64 |setConst|raints(d|
|000062c0| 2c 67 62 63 29 3b 0d 0a | 20 20 20 20 61 64 64 28 |,gbc);..| add(|
|000062d0| 64 29 3b 0d 0a 20 20 20 | 20 2f 2f 20 54 77 6f 20 |d);.. | // Two |
|000062e0| 62 75 74 74 6f 6e 73 3a | 20 22 4f 4b 22 20 61 6e |buttons:| "OK" an|
|000062f0| 64 20 22 43 61 6e 63 65 | 6c 22 0d 0a 20 20 20 20 |d "Cance|l".. |
|00006300| 50 61 6e 65 6c 20 70 20 | 3d 20 6e 65 77 20 50 61 |Panel p |= new Pa|
|00006310| 6e 65 6c 28 29 3b 0d 0a | 20 20 20 20 43 68 6f 6f |nel();..| Choo|
|00006320| 73 65 41 63 74 69 6f 6e | 4c 69 73 74 65 6e 65 72 |seAction|Listener|
|00006330| 20 61 63 74 69 6f 6e 4c | 69 73 74 65 6e 65 72 20 | actionL|istener |
|00006340| 3d 20 6e 65 77 20 43 68 | 6f 6f 73 65 41 63 74 69 |= new Ch|ooseActi|
|00006350| 6f 6e 4c 69 73 74 65 6e | 65 72 28 74 68 69 73 29 |onListen|er(this)|
|00006360| 3b 0d 0a 20 20 20 20 42 | 75 74 74 6f 6e 20 62 20 |;.. B|utton b |
|00006370| 3d 20 6e 65 77 20 42 75 | 74 74 6f 6e 28 22 4f 4b |= new Bu|tton("OK|
|00006380| 22 29 3b 0d 0a 20 20 20 | 20 62 2e 61 64 64 41 63 |");.. | b.addAc|
|00006390| 74 69 6f 6e 4c 69 73 74 | 65 6e 65 72 28 61 63 74 |tionList|ener(act|
|000063a0| 69 6f 6e 4c 69 73 74 65 | 6e 65 72 29 3b 0d 0a 20 |ionListe|ner);.. |
|000063b0| 20 20 20 70 2e 61 64 64 | 28 62 29 3b 0d 0a 20 20 | p.add|(b);.. |
|000063c0| 20 20 62 20 3d 20 6e 65 | 77 20 42 75 74 74 6f 6e | b = ne|w Button|
|000063d0| 28 22 43 61 6e 63 65 6c | 22 29 3b 0d 0a 20 20 20 |("Cancel|");.. |
|000063e0| 20 62 2e 61 64 64 41 63 | 74 69 6f 6e 4c 69 73 74 | b.addAc|tionList|
|000063f0| 65 6e 65 72 28 61 63 74 | 69 6f 6e 4c 69 73 74 65 |ener(act|ionListe|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.